You are here: Re: How to create a snapshot of a URL in PHP? « PHP Programming Language « IT news, forums, messages
Re: How to create a snapshot of a URL in PHP?

Posted by Csaba Gabor on 10/23/40 11:54

Miguel Cruz wrote:
> "BG Mahesh" <mahesh@mahesh.com> wrote:
> > Given a URL I want the snapshot of that page as an image. Something
> > like
> > http://pthumbnails.alexa.com/image_server.cgi?id=yoursite.com&size=large&url=h
> > ttp://google.com
> >
> > How do I achieve this in PHP?
>
> You can't, at least not with PHP on its own, unless you spend months
> developing an HTML renderer.
>
> How about scripting a web browser? You can install Mozilla on the
> server, and your PHP program can ask it to render the page, print it to

Hi Miguel. I'm not the OP, but would you please elaborate on how you
would get Mozilla to do this?

One possible approach is with a GreaseMonkey type of solution. But can
you use GM with javascript turned off? I have not investigated this.
I think one should have javascript turned off in deciding what,
exactly, to render, else you can run the javascript into a hole with an
alert.

One could also bring up Mozilla/FF directly with a page, but then I
don't know how to programatically direct it.

With IE ($ie=new COM("InternetExplorer.Application")) one can bring up
an instance of IE and load a page
($ie->Navigate2("http://www.myFavoriteDomain.com")), but I haven't
tried saving saving this (and it doesn't show me an option to save as
an image).

That is, in neither FF nor IE do I see the option to save the page as a
Postscript page or anything I would construe as an image. Where do I
look for this?

Csaba Gabor from Vienna

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация