Class: VgMarca
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 = {}) ⇒ VgMarca
constructor
A new instance of VgMarca.
- #service ⇒ Object
- #thumbnail ⇒ Object
- #title ⇒ Object
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, ={}) @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_url ⇒ Object
40 41 42 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 40 def download_url nil end |
#duration ⇒ Object
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 (width=425, height=344, ={}, 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='#{}'/>" end |
#embed_url ⇒ Object
28 29 30 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 28 def "http://www.marca.com/componentes/flash/embed.swf?ba=0&cvol=1&bt=1&lg=1&vID=#{@video_id}&ba=1" end |
#flv ⇒ Object
36 37 38 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 36 def flv REXML::XPath.first(@feed, "//media")[0].to_s end |
#service ⇒ Object
44 45 46 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 44 def service "Marca.tv" end |
#thumbnail ⇒ Object
20 21 22 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 20 def thumbnail REXML::XPath.first( @feed, "//foto" )[0].to_s end |
#title ⇒ Object
16 17 18 |
# File 'lib/acts_as_unvlogable/vg_marca.rb', line 16 def title REXML::XPath.first( @feed, "//titulo" )[0].to_s end |