thumbnailer is a Ruby library for getting thumbnail images from various sites with idiotic artificial intelligence.
- YouTube
- Flickr
- TwitPic
- Google Video
- Vimeo
- Dailymotion
- For unlisted sites WebSnapr
You need Flickr and WebSnapr Api key and you must set keys in thumbnailer.yml file. Sample configuration file under the example directory. If you are using Rails you may create the YOUR_RAILS_APP/config/thumbnailer.yml
Probably nothing.
here is an example:
module Thumbnailer
class VideoGoogle < Thumbnailer::Base
def initialize(uri)
begin
params = CGI.parse(uri.query)
doc = open("http://video.google.com/videofeed?docid=#{params['docid']}").read
doc = XML::Parser.string(doc).parse.find("//channel/item/media:group/media:thumbnail")
@thumb_image = doc[0]['url']
@small_thumb_image = @thumb_image
@embed_url = "#{uri.scheme}://#{uri.host}/googleplayer.swf?docId=#{params['docid']}"
rescue
end
end
end
end
- [sudo] gem i thumbnailer-ruby
- http://github.com/yalcin/thumbnailer
- git clone git://github.com/yalcin/thumbnailer.git
require 'rubygems'
require 'thumbnailer'
s = Thumbnailer::Fetcher.new('http://www.vimeo.com/12077673')
p s.media.thumb_image
p s.media.embed_url
- Yalcin ACIKYILDIZ ([email protected])
This library is released under the terms of the GNU/GPL.