Repository is archived
No commit activity in last 3 years
No release in over 3 years
thumbnailer is a Ruby library for getting thumbnail images from various sites with idiotic artificial intelligence.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Welcome to thumbnailer

thumbnailer is a Ruby library for getting thumbnail images from various sites with idiotic artificial intelligence.

Supported sites

  • YouTube
  • Flickr
  • TwitPic
  • Google Video
  • Vimeo
  • Dailymotion
  • For unlisted sites WebSnapr

Configuration

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

What is Idiotic Artificial Intelligence?

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

Download

Usage

require 'rubygems'
require 'thumbnailer'

s = Thumbnailer::Fetcher.new('http://www.vimeo.com/12077673')
p s.media.thumb_image
p s.media.embed_url

Authors

This library is released under the terms of the GNU/GPL.