PHP Classes
elePHPant
Icontem

WebThumbnail: Capture a screenshot of a page using WebThumbnail

Recommend this page to a friend!
  Info   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-04-30 (3 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 1,894 All time: 2,033 This week: 604Up
Version License PHP version Categories
webthumbnail 1.0BSD License5.3PHP 5, Web services, Geography
Description Author

This class can capture a screenshot of a page using WebThumbnail.

It can send a HTTP request to the WebThumbnail API Web server to request the capture of a screenshot of a given URL.

The service will queue the request to capture the specified page screenshot using one of the supported browsers: Firefox, Google Chrome or Opera.

The screenshot image may be capture with sizes between 70 by 70 and 2048 by 4096 pixels.

The class polls the capture server to determine when the screenshot is ready to download.

The retrieved screenshot image can be copied to a local file or served for download as the current script output in the PNG, JPEG or GIF formats.

Recommendations
Innovation Award
PHP Programming Innovation award nominee
May 2012
Number 2


Prize: One subscription to the PDF edition of the PHP Architect magazine
Some sites need to show previews of how a page of another site looks.

This class can generate image previews of a given site page using the WebThumbnail service.

Manuel Lemos
Name: Lukasz Cepowski <contact>
Classes: 3 packages by
Country: Poland Poland
Age: 28
All time rank: 119531 in Poland Poland
Week rank: 988 Up23 in Poland Poland Up
Innovation award
Innovation award
Nominee: 1x

Details
                  _     _   _                     _                 _ _ 
    __      _____| |__ | |_| |__  _   _ _ __ ___ | |__  _ __   __ _(_) |
    \ \ /\ / / _ \ '_ \| __| '_ \| | | | '_ ` _ \| '_ \| '_ \ / _` | | |
     \ V  V /  __/ |_) | |_| | | | |_| | | | | | | |_) | | | | (_| | | |
      \_/\_/ \___|_.__/ \__|_| |_|\__,_|_| |_| |_|_.__/|_| |_|\__,_|_|_|
                                                                    

                         http://webthumbnail.org
                         
               The simplest way to get a website screenshot!
               

1) What is webthumbnail.org?
The webthumbnail.org is a free webapi for capturing website screenshots.
Shortly speaking it is an web based application that you can simply integrate 
with your website and have thumbnails of any website on demand.

This project is a simple php client for using the api.webthumbnail.org directly
from the php code. It can be used in any php application,  distributed under
the terms of the BSD license.


2) How to use the api?
The simples case is to just call the api from pure html code.

<img src="http://api.webthumbnail.org?width=512&height=512&format=png&browser=firefox&url=http://webthumbnail.org" alt="Captured by webthumbnail.org" />

It will show a screenshot of http://webthumbnail.org directly on your website.
            
               
3) How to capture a website screenshot from php?

$thumb = new Webthumbnail("http://webthumbnail.org");
$thumb
    ->setWidth(512)
    ->setHeight(512)
    ->captureToOutput();
    
    
4) How to capture a website screenshot and save it to a disk file?

$thumb = new Webthumbnail("http://webthumbnail.org");
$thumb
    ->setWidth(512)
    ->setHeight(512)
    ->captureToFile($path);
    
5) Need more info?
Visit http://webthumbnail.org

Feel free to test and use the application :)


  Files folder image Files  
File Role Description
Files folder imageexamples (3 files)
Accessible without login Plain text file .project Data Auxiliary data
Accessible without login Plain text file README Doc. README
Plain text file webthumbnail.php Class The PHP wrapper class for http://webthumbnail.org

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file capture_to_browser.php Example Example, how to capture a website screenshot and send the image to the browser.
  Accessible without login Plain text file capture_to_file.php Example Example, how to capture a website screenshot and save the image into a disk file.
  Accessible without login Plain text file capture_without_delay.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:1,894
This week:0
All time:2,033
This week:604Up