Class: YouTube
Instance Method Summary collapse
- #embed_html ⇒ Object
-
#initialize(obj) ⇒ YouTube
constructor
A new instance of YouTube.
- #thumbnail_url ⇒ Object
Constructor Details
#initialize(obj) ⇒ YouTube
Returns a new instance of YouTube.
7 8 9 10 11 |
# File 'lib/you_tube.rb', line 7 def initialize(obj) @clip_id = obj.video_url.split('?v=').last @embed_url = "http://www.youtube.com/v/#{@clip_id}&hl=en&fs=1" @response = self.class.get("/feeds/api/videos/#{@clip_id}") end |
Instance Method Details
#embed_html ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/you_tube.rb', line 17 def <<-END <object width="425" height="344"> <param name="movie" value="#{@embed_url}" /> <param name="allowFullScreen" value="true" /> <embed src="#{@embed_url}" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344" /> </object> END end |
#thumbnail_url ⇒ Object
13 14 15 |
# File 'lib/you_tube.rb', line 13 def thumbnail_url @response["entry"]["media:group"]["media:thumbnail"][0]["url"] end |