Donnerstag
Jul102008
RubyGem for webthumb
Donnerstag, Juli 10, 2008 at 5:20PM
Webthumb is a service to create thumbnails from websites (descriptive name, isn't it...). It creates different sized thumbnails by default and you can request custom sizes.It offers an API to access it's services and we wrapped up some code i wrote while on vacation and bundled it as a gem.The code is still a bit clumsy (as i wrote it on vacation :-) ) but it works nice for us. There is already another ruby wrapper for the API but it is not available as a RubyGem and does not expose some of the latest webthumb functionalities so we decided to write our own library. Josh gave us some extra credits so we could develop the API. Thanks. The gem is available on Simplificator's github repo. To install do following:
To create thumbnails:
For more info check the README file and (currently) the source code. All the features from a the request element are supported but currently not documented. I'll look into that in some days.If you want to use the Gem you'll need an account for webthumb. You'll get 100 free credits every month so it's easy to try it out.
sudo gem update --system (in case you are not yet on version 1.2.0 or higher)
sudo gem sources -a http://gems.github.com (only once)
sudo gem install simplificator-rwebthumbTo create thumbnails:
require 'rubygems'
require 'rwebthumb'
include Simplificator::Webthumb
# main access point for the Webthumb API
wt = Webthumb.new('YOUR API KEY HERE')
job = wt.thumbnail(:url => 'http://simplificator.com')
job.write_file(job.fetch_when_complete(:large), '/tmp/test.jpg')For more info check the README file and (currently) the source code. All the features from a the request element are supported but currently not documented. I'll look into that in some days.If you want to use the Gem you'll need an account for webthumb. You'll get 100 free credits every month so it's easy to try it out.


Reader Comments (6)
[...] web applications « RubyGem for webthumb [...]
Also make sure you sudo gem install tzinfo.
Alex
Hey Alex
tzinfo is mentioned as dependency. It is used to convert from MST to UTC time.
I added it in installation section to make sure everything is working..
Pascal
On Thursday Oct. 8 around 10AM PDT the bluga service had "queueing issues". As a result our requests tot he service using the ruby webthumb API entered endless loops. This is because the fetch_when_complete method continued in an endless loop as long as it was able to get valid responses from the server (presumably the response that says "still working on it").
The bluga site is fixed and should not have such issues but there is always the chance something else will happen to the service.
I am going to modify/monkey patch Simplificator::Webthumb::Job.fetch_when_complete to take a timeout parameter so that it doesnt check in an endless loop forever.
If you want the modification, can you send me an email with some instructions on where to send the modified code?
Thanks, Mike
we provides you the best and most fashionable products. All the products are 100% high quality, competitive price, free shipping with best and timely service, 100% satisfaction. Big discount for big order. Welcome to make your choose.
ugg
ugg boots
ugg shoes
ugg tall boots
ugg short boots
ugg kids
ugg women
ugg men
cheap ugg
weight loss
diet pills
how to lose weight fast
louis vuitton
replica handbags
lv
louis vuitton bags
louis vuitton handbags
discount handbags
lv
discount handbags
louis vuitton bags
louis vuitton
replica handbags
lv
louis vuitton bags
louis vuitton handbags
discount handbags
lv
discount handbags
louis vuitton bags
christian louboutin
louboutin
christian louboutin shoes
louboutin shoes
bridal shoes
sexy shoes
high heels shoes
christian louboutin
louboutin
christian louboutin shoes
louboutin shoes
bridal shoes
sexy shoes
high heels shoes
ed hardy
ed hardy clothing
ed hardy clothing shirts
ed hardy clothes
ed hardy t shirts
ed hardy
ed hardy clothing
ed hardy clothing shirts
ed hardy clothes
ed hardy t shirts
rosetta stone
rosetta stone software
rosetta
chaojimengnan supplier
chaojimengnan
wholesale gucci clothing provides you the best and cheapest bags. All the products at http://www.gucci-buying.com are 100% high quality, competitive price, free shipping with best and timely service, 100% satisfaction. Big discount for big order. Welcome to make your choose.