how to get a picture of a website?

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
cheerio
Forum Newbie
Posts: 18
Joined: Sat Aug 13, 2005 4:52 pm

how to get a picture of a website?

Post by cheerio »

can someone please post the PHP code to getting a screen shot of a website...i've seen it on like some domain search engines and would really like to know how this is done
i've searched lots of different things but didn't really find what i was looking for
i wasn't to sure exactly where to post this so sorry in advanced

thanks in advanced

and thanks to PHPdn for building such a large PHP community.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

basically, it's done through an automated navigation of a browser and screencapture utility on the machine. You don't really have any hardware interaction within php itself, but you can ask the system to perform the actions required through php.
cheerio
Forum Newbie
Posts: 18
Joined: Sat Aug 13, 2005 4:52 pm

Post by cheerio »

oh i see, thanks for the quick reply :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Some one should make a service that allows developers without the resources to get screenshots (if this doesn't already exist)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I remember such a "service" existing in some fashion...... it was like a browser test project so a web dev could see how their stuff looked in many various browsers and platforms...
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

I remember seeing that once, but it cost money... the thing I had in mind would be like 1,000 free screen shots a month or something, after that $1 / 100 screenshots. The dev could file_get_conents("http://example.com?url=$url"); and it would return an image stream or something.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

http://www.danvine.com/icapture/ was free for a while, looks like you have to register now (for free).
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Sorry to hijack the thread but I have a question. What if I wanted to set up a machine and run a service like this. How are they making the API call to the browser, and taking the screenshots? Is there a program? Is so what are they called, or can you name a few for linux & windows?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

most likely a simple exec() call. As for the program they use, not sure.
Post Reply