I'm trying to figure out how to generate snapshot, thumbnail-like images of live web pages on the Internet. The images will be used to preview text links, appearing when you mouse over the links.
I've done some searching on this, and I can't find a solution that doesn;t involve manipulating someone else's online web service (i.e., http://www.websnapr.com/) with a client-side scripting language like JavaScript.
I'd prefer to generate the snapshots myself, with my own script, and then use JavaScript to manipulate the results (of my script).
The problem is that I can't figure out how the web site snapshots were created. Can you use PHP to do this, perhaps using the image functions?
If you can use PHP to accomplish the snapshot images, I'd appreciate anyone who could steer me in the right direction here. Some sample code illustrating how this is done -- or a tutorial -- would help.
From what I've seen you need to do it one of these ways ...
1) Have some software running on your own web server (you host your own website).
2) Use some ActiveX applications on your own server if Windows.
3) Use an outside (remote) service.
So the answer is no ... you can't just use PHP to create a thumbnail
from a URL. At least I have never seen a way to do it.
I also checked with Perl ... same thing. You need your own server.
I'm trying to figure out how to generate snapshot, thumbnail-like images of live web pages on the Internet. The images will be used to preview text links, appearing when you mouse over the links.
I've done some searching on this, and I can't find a solution that doesn;t involve manipulating someone else's online web service (i.e., http://www.websnapr.com/) with a client-side scripting language like JavaScript.
There is a windows solution, but I don't bookmark the site.
Quote:
I'd prefer to generate the snapshots myself, with my own script, and then use JavaScript to manipulate the results (of my script).
The problem is that I can't figure out how the web site snapshots were created. Can you use PHP to do this, perhaps using the image functions?
If you can use PHP to accomplish the snapshot images, I'd appreciate anyone who could steer me in the right direction here. Some sample code illustrating how this is done -- or a tutorial -- would help.
Thanks.
I still looking for a solution, above link use xvfb and that means you must have x instaled on the server and, if I'm not wrong, a browser.
Let's say that you can avoid, rewriting the code, to use the browser but you still need xvfb.
PS: I need a perl solution not php, but if there is one, could be easy ported. Please post any usefull info here, I'll do the same.
Why not just make the screen shots yourself? I'm sure webpages wouldn't change all that much over a month or so, so just update them yourself every month or so.
Why not just make the screen shots yourself? I'm sure webpages wouldn't change all that much over a month or so, so just update them yourself every month or so.
- a small/medium site is over 800 pages, it take some time,
- a site with most then, let's say 80%, content older than one month is dead,
on linux, if you have X running (which most web-servers won't...), then there are ways ('xwd' off the top of my head...) that will let you grab the contents of the screen. Using exec (or similar), you could launch a browser (opera and firefox at least will accept URLs as arguments, you can 'remote control' opera quite a lot, so you could leave that running and just send commands to it...) and then exec xwd to take the screenshot and save it to a file.
I'd be surprised if OS-X didn't have something similar built in, and there are probably ways to do it for windows- DirectX can probably do it.
on linux, if you have X running (which most web-servers won't...), then there are ways ('xwd' off the top of my head...) that will let you grab the contents of the screen. Using exec (or similar), you could launch a browser (opera and firefox at least will accept URLs as arguments, you can 'remote control' opera quite a lot, so you could leave that running and just send commands to it...) and then exec xwd to take the screenshot and save it to a file.
I'd be surprised if OS-X didn't have something similar built in, and there are probably ways to do it for windows- DirectX can probably do it.
Also, I thought there was a php function (windows only) that would grab a screenshot of a URL that came out in PHP5. I'm pretty positive I've read this on the php.net site. I'll be double checking.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
Also, I thought there was a php function (windows only) that would grab a screenshot of a URL that came out in PHP5. I'm pretty positive I've read this on the php.net site. I'll be double checking.
Well, I'm not using my own server in this instance, so my options are limited here, apparently...
I basically did the following, using the online websnapr service (the code might not be perfect since I extracted the relevant code for this post -- I'll let you guys test it for your own use):
I forgot to add the following code to the JS earlier...it's there now:
Code:
// Global variables
var linksources = new Array(
['http://images.websnapr.com/?size=s&url=',202,152],
['http://thumbnails.alexa.com/image_server.cgi?size=small&url=',160,120],
['http://msnsearch.srv.girafa.com/srv/i?s=MSNSEARCH&r=',160,120]
);
var linksource = 0;
You can use www.w3snapshot.com for generating website snapshots. It is an online tool. You use this in blogs, directories and other places. w3snapshot comes with integration tool.
HI
I have tested a lot of tools a site sites thumbnail generators to use with a pligg (digg style sms) site but I think that http://www.megasnaps.com is the best for this use. His free web site to image page, create a image of the whole html page, and offers a cropped options too to be downloaded.
The website thumbnails generator service are a good option for any type of web sites, offers a full page and custom sizes for the cheaper price tha I have found. I do a great instalation with 'facebox' (jquery), by clicking on a small image it open a larger one 'facebook style' image with a full size snapshot looks great!.
hope it helps.
Last edited by george2177; 11-13-2011 at 12:30 PM..