From: David Vallner Date: 2006-11-05T21:44:49+09:00 Subject: Re: how to got a preview of a web page --------------enig096EC8CD729B458404FA2919 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Haofei wrote: > for example i want to have a method which just like >=20 > def preview_of ( url ) > #some relate operation > end >=20 > then i can have a picture (jpeg, png ...) of the web page somewhere, > i am not familiar with the graphic libraries of ruby. > do u guys have write something like this ? > thanks :-) >=20 def preview_of(url) `opera -newpage #{url}` end *cough* Seriously, this is a nontrivial example that requires you to more or less write a webbrowser. The simplest (relatively speaking) way would be to use ruby-gnome2 and Gtk::MozEmbed, and severe whacking of Gtk with a cluebyfour to make it render to an image buffer which you'd then output to disk. David Vallner --------------enig096EC8CD729B458404FA2919 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFTdyzy6MhrS8astoRAiT/AJ9rARbI9wiQAB1yRurEw7u69TQCPgCfQJrq vAFi2DnrHHhB8z9RVO+wv8w= =G5p3 -----END PGP SIGNATURE----- --------------enig096EC8CD729B458404FA2919--