Class: VgDalealplay
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 = {}) ⇒ VgDalealplay
constructor
A new instance of VgDalealplay.
- #service ⇒ Object
- #thumbnail ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(url = nil, options = {}) ⇒ VgDalealplay
Returns a new instance of VgDalealplay.
11 12 13 14 15 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 11 def initialize(url=nil, ={}) @url = url @video_id = @url.query_param('con') @page = Hpricot(open(url)) end |
Instance Method Details
#download_url ⇒ Object
41 42 43 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 41 def download_url nil end |
#duration ⇒ Object
29 30 31 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 29 def duration nil end |
#embed_html(width = 425, height = 344, options = {}) ⇒ Object
33 34 35 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 33 def (width=425, height=344, ={}) "<object type='application/x-shockwave-flash' width='#{width}' height='#{height}' data='#{}'><param name='quality' value='best' /> <param name='allowfullscreen' value='true' /><param name='scale' value='showAll' /><param name='movie' value='http#{}' /></object>" end |
#embed_url ⇒ Object
25 26 27 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 25 def @page.search("//link[@rel='video_src']").first.attributes["href"].sub("autoStart=true", "autoStart=false") end |
#flv ⇒ Object
37 38 39 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 37 def flv "http://videos.dalealplay.com/contenidos3/#{CGI::parse(URI::parse().query)['file']}" end |
#service ⇒ Object
45 46 47 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 45 def service "dalealplay" end |
#thumbnail ⇒ Object
21 22 23 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 21 def thumbnail "http://images-00.dalealplay.com/contenidos2/#{@video_id}/captura.jpg" end |
#title ⇒ Object
17 18 19 |
# File 'lib/acts_as_unvlogable/vg_dalealplay.rb', line 17 def title (Iconv.iconv 'utf-8', 'iso-8859-1', @page.search("//title").inner_html.split(" - www.dalealplay.com")[0]).to_s end |