Class: VgMarca

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

Instance Method Summary collapse

Constructor Details

#initialize(url = nil, options = {}) ⇒ VgMarca

Returns a new instance of VgMarca.



9
10
11
12
13
14
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 9

def initialize(url=nil, options={})
  @url = url
  @video_id = @url.query_param('v')
  res =  Net::HTTP.get(URI.parse("http://estaticos.marca.com/consolamultimedia/marcaTV/elementos/#{@video_id[0,1]}/#{@video_id[1,1]}/#{@video_id[2,100]}.xml"))
  @feed = REXML::Document.new(res)    
end

Instance Method Details

#download_urlObject



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

def download_url
  nil
end

#durationObject



24
25
26
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 24

def duration
  nil
end

#embed_html(width = 425, height = 344, options = {}, params = {}) ⇒ Object



32
33
34
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 32

def embed_html(width=425, height=344, options={}, params={})
  "<embed width='#{width}' height='#{height}' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowfullscreen='true' quality='high' src='#{embed_url}'/>"
end

#embed_urlObject



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

def embed_url
  "http://www.marca.com/componentes/flash/embed.swf?ba=0&cvol=1&bt=1&lg=1&vID=#{@video_id}&ba=1"
end

#flvObject



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

def flv
  REXML::XPath.first(@feed, "//media")[0].to_s
end

#serviceObject



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

def service
  "Marca.tv"
end

#thumbnailObject



20
21
22
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 20

def thumbnail
  REXML::XPath.first( @feed, "//foto" )[0].to_s
end

#titleObject



16
17
18
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 16

def title
  REXML::XPath.first( @feed, "//titulo" )[0].to_s
end