tags:

views:

299

answers:

5

I am trying to find a PHP script (or a script in a different language) that after passing a URL, it takes a screenshot of the website for that URL. So for example if I pass stackoverflow.com, it should take a screen shot of the website (in this case the homepage), keep it on the server, and provide a link to that pic.

Is there an easy way to do that?

I know it is possible because that's how they take thumbnails for websites in Alexa for example.

If you need more explanation of what I mean please just post a comment and I will explain more.

Thank you :)

A: 

You can use browsershots.org service or litmusapp.com. Both of these will generate screenshot of a page. You can then download the screenshot and use it in a way you need to.

michal kralik
the problem with browsershots.org is that it shows the firefox frame as well, i just want a pic of the website itself
Couldn't you just then crop the resulting image to remove the firefox frame?
Blair McMillan
but do they provide an API so i can use that?
A: 

Start a Browser (like system("firefox [url]")), run a screengrabber for that window and save the image somewhere.

Since the output is always depending on the render engine used it is not possible by using php alone.

Other option would be to embed a rendering engine (Gecko or similar) into your php script.

dbemerlin
A: 

Something like Litmus?

Blair McMillan
something like that, but their plans are expensive, is there a way to get the technology behind the site. Also, it is very slow, it take couple of mins to get a screenshot, is there a way to do that faster?
+2  A: 

Here is a similar question:

Also try www.thumbshots.com.

Adnan
A: 

Browsershots normally has their backend source code available, but as of this answer, it appears to be offline at the moment. There is an outdated mirror on Github which you can look at.

Paul Fisher