Thmbnl.com PHP 5 API

 

Version 1.0 - 2/26/08

 

Requirements:

  •   PHP 5

 

Usage:

 

<?php

  require_once 'thmbnl.php';

 

  # Auth Keys

  $consumer_key = 'CONSUMER_KEY';

  $consumer_secret = 'CONSUMER_SECRET';

  $token = 'TOKEN';

  $token_secret = 'TOKEN_SECRET';

 

  $t = new Thmbnl( $consumer_key, $consumer_secret, $token, $token_secret );

 

  # Test Find

  echo $t->find('www.thmbnl.com', 320) . "\n\n";

 

  # Test Create

  if( $t->create('www.thmbnl.com') ){

    echo "OK!";

  }else{

    echo $t->error;

  }

 

?>

 

Methods:

 

find( url, size ) - Returns a thumbnail URL for a specified site/size.

 

  params:

    url : valid http/https URL

    size: 60, 100, 160, 320, 800 (pixel widths)

 

  returns:

    URL of thumbnail image for the specified site/size

 

 

 

create( url ) - Add a URL to the Thmbnl.com queue to be thumbnailed.

  params:

    url: valid http/https url

 

  returns (boolean):

    true:

      Thmbnl creation was successful. The URL has been added to the queue and a thumbnail should be available shortly.

    false:

      Thmbnl creation failed. See error() for details.

 

 

error()

  returns:

    Last error from Thmbnl. May include:   

  •       url already exists


Page Information

  • 6 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts