views:

747

answers:

5

I need to create Snapshots / Thumbshots / Site preview a-site.com.

There are some site as thumbshot.org that meets with I need. But I do not want to use an external service, not to depend on others for my project (What would happen if they close the site?)

For this reason, I am looking for some project to let me do this.

Any idea?

+1  A: 

There isn't anything in the PHP library to do this - you're looking at setting up an external application (with a queue) to take images, although you can of course use PHP to add items to the queue.

There are a couple of Windows functions in GD that takes screen shots of the computer (webserver - not the client) so perhaps you could write a script in PHP to do this.

Edit: Was thinking of these: imagegrabscreen and imagegrabwindow. I'm not sure they will do what you want however (even in full screen mode Firefox has ablue bar at the top of the screen - not sure about other browsers). However, Pierre has something on these functions if you're interested.

I'd suggest writing an application in another language (I assume .NET has something) to do this for you. Edit: This page tells you how to do it in C#

Ross
+1  A: 

On windows you can use GD's imagegrabwindow() function.

Edit: The help page actually shows you how to grab a screenshot from IE.

Greg
Thanks.At least now I have an idea where to go.I did not know that function.I will try to make a script that generates the snap and go through automatically tftp
A: 

There's not much PHP would do for you in this situation. You'd need a complete (X)HTML rendering engine with CSS-support, possibly also with JavaScript support.

That, or use some kind of kinky script that would launch a real browser, and take a screenshot out of that. Either way, PHP is probably not the right tool for the operational part.

Henrik Paul
A: 

There's a Firefox extension that converts the webpage you're viewing to an image:

http://www.screengrab.org/

http://addons.mozilla.org/en-US/firefox/addon/1146

If you're willing to get creative, it might be possible to access this problematically.

TravisO
A: 

Thanks to all. I found a pseudo-solution, (using dcom + imagegrabscreen + wamp). I need to resize the final.png with gd, because the png is equal to resolution of client (in my home, is a picture of 1650*1280). Whe I end this, I will post a .zip file to dowload Thanks again (But if anyone have a better idea, I am happy to see that)

PS: Sorry for my english