Login   Register  
PHP Classes
elePHPant
Icontem

File: webthumbnail.example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jakub Krol  >  Glowfoto API  >  webthumbnail.example.php  >  Download  
File: webthumbnail.example.php
Role: Example script
Content type: text/plain
Description: Example using image`s content instead of filename. Requires webthumbnail Class.
Class: Glowfoto API
Upload images to Glowfoto using its API
Author: By
Last change:
Date: 2012-10-01 09:42
Size: 924 bytes
 

Contents

Class file image Download
<?php
    
//This is example of getting and saving website screenshot.
    //This example requires webthumbnail class. Visit http://api.webthumbnail.org for more information.

    
if ($_GET['url']=='') die('Type &/?url=websiteUrl at the end of address bar to make website screenshot.');
    include_once(
'glowFoto.class.php');
    include_once(
'webthumbnail.class.php'); // <-- http://www.phpclasses.org/package/7479-PHP-Capture-a-screenshot-of-a-page-using-WebThumbnail.html
    
set_time_limit(300); // It may take some time, as webthumbnail.org can be simetimes slow
    
$thumb = new Webthumbnail($_GET['url']);
    
$response $thumb->capture()->getResponse(); //wait till capture is ready...
    
$glowFoto = new GlowFotoAPI();
    
$glowFoto->setThumbSize(GlowFotoAPI::THUMB_SIZE_400);
    
$URLs=$glowFoto->fastSendFromPOSTOrFileContent($response);
    echo 
'READY!<br><center>'.$URLs['HTML'].'</center>';
?>