Php site image grab
Moderator: General Moderators
Php site image grab
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?
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
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.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?
Here is an example of a site that does it:
http://www.whois.sc/devnetwork.net
Still no idea how it is done. Anyone?
http://www.whois.sc/devnetwork.net
Still no idea how it is done. Anyone?
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:hawleyjr wrote:Here is an example of a site that does it:
http://www.whois.sc/devnetwork.net
Still no idea how it is done. Anyone?
Code: Select all
konqueror http://www.example.com --dump-to /home/Roja/screenshot.pngAlso, 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.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
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 someone bet me $5 that they could find a perl module to BAKE COOKIES, I honestly would hesitate. They have EVERYTHING in cpan.
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?
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
http://timvw.madoka.be/programming/vbs/ ... ot.vbs.txt
which only works on windows. >.>
For linux, open up a konqueror (/firefox/whatever) window and use
for the whole screen. Haven't figured out how to just do konqueror yet.
For linux, open up a konqueror (/firefox/whatever) window and use
Code: Select all
import -window root screenshot.jpg