thmbnl.com Ruby API

 

Version 1.0 - 2/26/08

 

Requirements:

  •   Ruby 1.8.6
  •   OAuth Gem

 

Usage:

 

  require 'Thmbnl'

 

    t = Thmbnl.new( :consumer_key => 'CONSUMER_KEY',

                  :consumer_secret => 'CONSUMER_SECRET',

                  :token => 'TOKEN',

                  :token_secret => 'TOKEN_SECRET' )

 

# Find thumbnail URLs

  url = t.find("http://www.thmbnl.com", :size => 100)

  puts url

 

# Add a URL to the Thmbnl queue for thumbnailing

  if t.create("http://www.thmbnl.com")

    puts "OK!"

  else

    puts t.error

  end

 

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