Class: Vg11870
Instance Method Summary collapse
- #download_url ⇒ Object
- #duration ⇒ Object
- #embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object
- #embed_url ⇒ Object
- #flv ⇒ Object
-
#initialize(url = nil, options = {}) ⇒ Vg11870
constructor
A new instance of Vg11870.
- #service ⇒ Object
- #thumbnail ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(url = nil, options = {}) ⇒ Vg11870
Returns a new instance of Vg11870.
9 10 11 12 13 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 9 def initialize(url=nil, ={}) @url = url @page = Hpricot(open(url)) @flashvars = CGI::parse(@page.to_s.split("flashvars="")[1].split(""")[0]) end |
Instance Method Details
#download_url ⇒ Object
40 41 42 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 40 def download_url nil end |
#duration ⇒ Object
23 24 25 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 23 def duration nil end |
#embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object
32 33 34 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 32 def (width=425, height=344, ={}, params={}) "<object width='#{width}' height='#{height}' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'> <param name='movie' value='#{}' /> <param name='quality' value='high' /><embed src='#{}' width='#{width}' height='#{height}' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/></object>" end |
#embed_url ⇒ Object
27 28 29 30 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 27 def query = @flashvars.map {|k,v| "&#{k}=#{v}"} "http://11870.com/multimedia/flvplayer.swf?#{query}" end |
#flv ⇒ Object
36 37 38 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 36 def flv @flashvars['file'] end |
#service ⇒ Object
44 45 46 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 44 def service "11870.com" end |
#thumbnail ⇒ Object
19 20 21 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 19 def thumbnail @flashvars['image'] end |
#title ⇒ Object
15 16 17 |
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 15 def title CGI::unescapeHTML @page.search("//h1[@class='fn name']/a").first.inner_html end |