Class: Thumbnailer::YouTube
- Defined in:
- lib/thumbnailer/sites/youtube.rb
Instance Attribute Summary
Attributes inherited from Base
#embed_url, #small_thumb_image, #thumb_image
Instance Method Summary collapse
-
#initialize(uri) ⇒ YouTube
constructor
A new instance of YouTube.
Constructor Details
#initialize(uri) ⇒ YouTube
Returns a new instance of YouTube.
3 4 5 6 7 8 9 |
# File 'lib/thumbnailer/sites/youtube.rb', line 3 def initialize(uri) params = CGI.parse(uri.query) temp_img_url = "http://img.youtube.com/vi" @small_thumb_image = "#{temp_img_url}/#{params['v']}/2.jpg" @thumb_image = "#{temp_img_url}/#{params['v']}/0.jpg" @embed_url = "http://www.youtube.com/v/#{params['v']}" end |