Class: VgRutube
Instance Method Summary collapse
- #download_url ⇒ Object
- #duration ⇒ Object
- #embed_html(width = 425, height = 344, options = {}) ⇒ Object
- #embed_url ⇒ Object
- #flv ⇒ Object
-
#initialize(url = nil, options = {}) ⇒ VgRutube
constructor
A new instance of VgRutube.
- #service ⇒ Object
-
#thumbnail ⇒ Object
this method of extraction is somewhat fragile to changes in RuTube urls more correct way would be using rt_info structure, like it was done in title().
- #title ⇒ Object
Constructor Details
#initialize(url = nil, options = {}) ⇒ VgRutube
Returns a new instance of VgRutube.
3 4 5 6 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 3 def initialize(url=nil, ={}) @url = url parse_url(url) end |
Instance Method Details
#download_url ⇒ Object
46 47 48 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 46 def download_url nil end |
#duration ⇒ Object
50 51 52 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 50 def duration nil end |
#embed_html(width = 425, height = 344, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 26 def (width=425, height=344, ={}) # overridden cause we have to change default size if needed return <<-"END" <object width="#{width}" height="#{height}"><param name="movie" value="#{}"></param><param name="wmode" value="window"></param><param name="allowFullScreen" value="true"></param><embed src="#{}" type="application/x-shockwave-flash" wmode="window" width="#{width}" height="#{height}" allowFullScreen="true"></embed> </object> END end |
#embed_url ⇒ Object
21 22 23 24 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 21 def # path to swf "http://video.rutube.ru/#{movie_hash}" end |
#flv ⇒ Object
40 41 42 43 44 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 40 def flv # Fragile, untested, issues one redirect to actual location # can't be extracted from rt_info "http://bl.rutube.ru/#{movie_hash}.iflv" end |
#service ⇒ Object
54 55 56 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 54 def service "Rutube" end |
#thumbnail ⇒ Object
this method of extraction is somewhat fragile to changes in RuTube urls more correct way would be using rt_info structure, like it was done in title()
14 15 16 17 18 19 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 14 def thumbnail # size=1 gives bigger thumbnail. # I'm not sure how to add size parameter in compatible way size = 2 "http://img.rutube.ru/thumbs/#{movie_hash[0,2]}/#{movie_hash[2,2]}/#{movie_hash}-#{size}.jpg" end |
#title ⇒ Object
8 9 10 |
# File 'lib/acts_as_unvlogable/vg_rutube.rb', line 8 def title rt_info["movie"][0]["title"][0].strip end |