php script to make website thumbs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tanares
Forum Newbie
Posts: 2
Joined: Mon Oct 17, 2011 3:34 pm

php script to make website thumbs

Post by tanares »

i want to create a php script that will make screenshots/thumbnails of url
any ideas???
ouchiko
Forum Commoner
Posts: 35
Joined: Sun Oct 09, 2011 6:54 pm
Location: London

Re: php script to make website thumbs

Post 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.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: php script to make website thumbs

Post 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
Post Reply