Class: Vg11870

Inherits:
Object show all
Defined in:
lib/acts_as_unvlogable/vg_11870.rb

Instance Method Summary collapse

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, options={})
  @url = url
  @page = Hpricot(open(url))
  @flashvars = CGI::parse(@page.to_s.split("flashvars="")[1].split(""")[0])
end

Instance Method Details

#download_urlObject



40
41
42
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 40

def download_url
  nil
end

#durationObject



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 embed_html(width=425, height=344, options={}, 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='#{embed_url}' /> <param name='quality' value='high' /><embed src='#{embed_url}' width='#{width}' height='#{height}' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/></object>"
end

#embed_urlObject



27
28
29
30
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 27

def embed_url
  query = @flashvars.map {|k,v| "&#{k}=#{v}"}
  "http://11870.com/multimedia/flvplayer.swf?#{query}"
end

#flvObject



36
37
38
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 36

def flv
  @flashvars['file']
end

#serviceObject



44
45
46
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 44

def service
  "11870.com"
end

#thumbnailObject



19
20
21
# File 'lib/acts_as_unvlogable/vg_11870.rb', line 19

def thumbnail
  @flashvars['image']
end

#titleObject



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