Sha256: 56265dfb353f75e1006e9afbcd916cdb276eb716b5abaee41933d9dc8df4e168
Contents?: true
Size: 588 Bytes
Versions: 3
Compression:
Stored size: 588 Bytes
Contents
module Thumbnailer class Vimeo < Thumbnailer::Base def initialize(uri) video_id = uri.path.split('/')[1] doc = XML::Parser.string(open("http://vimeo.com/api/v2/video/#{video_id}.xml").read).parse.find("//videos/video/*") doc.each { |item| case item.name when "id" @embed_url = "http://vimeo.com/moogaloop.swf?clip_id=#{item.content}" when "thumbnail_small" @small_thumb_image = item.content when "thumbnail_medium" @thumb_image = item.content end } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thumbnailer-ruby-0.1.2 | lib/thumbnailer/sites/vimeo.rb |
thumbnailer-ruby-0.1.1 | lib/thumbnailer/sites/vimeo.rb |
thumbnailer-ruby-0.1.0 | lib/thumbnailer/sites/vimeo.rb |