Page 1 of 1
Php site image grab
Posted: Thu Jun 02, 2005 5:10 pm
by Lucvh
Is there any way i could code somethign that would visit the imputted url, and output a section of the page into an image gd jpeg?
Posted: Thu Jun 02, 2005 5:55 pm
by shiznatix
you want to capture the entire page as a image as like take a screen shot of the webpage then posting that on your website? i really dont think that is possible because you can only open another website as a html file perdy much but you might be able to just compress everything into a real small area then display that?
Posted: Fri Jun 03, 2005 1:17 am
by Syranide
something which is not available by default of my understanding... understandably as this imposes many many problems... such as the width of the page, flashanimations, javascripts and so on... I bet if you want a standalone application there is likely some project in betastage.
Posted: Sat Jun 04, 2005 3:46 pm
by Lucvh
i mean for use instead of iframes, could you make it so that it outputted just a section of text,from a page, a part before and after a certain point in the html?
Posted: Sat Jun 04, 2005 4:16 pm
by Skara
shiznatix wrote:you want to capture the entire page as a image as like take a screen shot of the webpage then posting that on your website? i really dont think that is possible because you can only open another website as a html file perdy much but you might be able to just compress everything into a real small area then display that?
This is possible. My old hosting company did it. In the admin panel, there'd be a little thumbnail screenshot of your website.

No clue how they did it, but it
was automated, as it updated instantly.
Posted: Sun Jun 05, 2005 9:01 am
by Lucvh
yeah, that is what i would like, ahs anyone got an idea how you would code it?
Posted: Sun Jun 05, 2005 12:48 pm
by hawleyjr
Here is an example of a site that does it:
http://www.whois.sc/devnetwork.net
Still no idea how it is done. Anyone?
Posted: Sun Jun 05, 2005 12:56 pm
by Roja
I'm guessing they actually open a graphical browser (automated) and take a screenshot/dump from that. I suspect there may be a commandline version for one of the opensource browsers, like konqueror that allows it. Like:
Code: Select all
konqueror http://www.example.com --dump-to /home/Roja/screenshot.png
But beyond that, I have no idea.
Also, they are running mod_perl, and use url rewriting, so we can't be sure its going to php and not perl for the results.. It may be a perl module - I wouldn't be shocked.
If someone bet me $5 that they could find a perl module to BAKE COOKIES, I honestly would hesitate. They have EVERYTHING in cpan.
Posted: Sun Jun 05, 2005 2:25 pm
by Ambush Commander
If someone bet me $5 that they could find a perl module to BAKE COOKIES, I honestly would hesitate. They have EVERYTHING in cpan.
Ah, that'd be easy. You'd just have to define a protocol for the oven and then set up the physical connection... wait... that's not so easy.
If konquerer can do it, and it can be done completely via commandline, I don't see why you can't just plug PHP into it. Do some research, we shall, hmm?
Posted: Sun Jun 05, 2005 4:26 pm
by timvw
I've written a little script that does this... But it was a major pita because it required that IE got focus... So a solution on a machine with X seems better
http://timvw.madoka.be/programming/vbs/ ... ot.vbs.txt
Posted: Sun Jun 05, 2005 4:33 pm
by Skara
which only works on windows. >.>
For linux, open up a konqueror (/firefox/whatever) window and use
Code: Select all
import -window root screenshot.jpg
for the whole screen. Haven't figured out how to just do konqueror yet.