Page 1 of 1

php script to make website thumbs

Posted: Mon Oct 17, 2011 4:01 pm
by tanares
i want to create a php script that will make screenshots/thumbnails of url
any ideas???

Re: php script to make website thumbs

Posted: Tue Oct 18, 2011 4:44 am
by ouchiko
I'll bite.

I don't think PHP is the best solution for this - I would suspect that you'd need to investigate GTK PHP and it'd be a better idea to use an already built linux based alternative [of which there are plenty]. I'll assume linux but you'd be easily able to locate a similar Windows alternative.


http://freshmeat.net/projects/scrot/
http://sourceforge.net/projects/webcapture/

Don't reinvent the wheel - use something with a mature development cycle and then use the images/data for your own purpose.

Also, I've been screen grabbing sites for a while now http://server-2.webcoding.co.uk/BBCArch ... ilter=news and it can take up a LOT of disk space. Unlike my advice :-) I made my own C# screen capture program but this was for a different purpose / idea I had. http://server-2.webcoding.co.uk/blog/wp ... rogram.jpg - but there are loads of ways to solve your problem.

Anyway - best of luck
Jim.

Re: php script to make website thumbs

Posted: Tue Oct 18, 2011 3:15 pm
by twinedev
Well, a key issue that should be answered is that is the purpose of making the snapshots of the site. Are you intending for something automatic that runs on a web server (ie, you are not using desktop to manually execute it?) This will make a big difference in the way you go.

I have a web server I played around with the option of installing x-windows and firefox, and trying to use command line arguments to firefox to create a PDF of a site. Got it all going, but would still crash out as I didn't know how to define a "default" desktop (resolutions and such I'm guessing), so firefox would crash out. I couldn't easily set up a desktop, since the server was at the time in a rack in a data center. This option also had the overhead of needing to keep x-windows on it and make sure it was always up to date as well.

Seems funny, another forum that I moderate on has a very similar request...

-Greg