Changeset 32340 for lang/ruby/video_scraper/lib/www/video_scraper/veoh.rb
- Timestamp:
- 04/13/09 13:11:05 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/video_scraper/lib/www/video_scraper/veoh.rb
r30120 r32340 6 6 module VideoScraper 7 7 class Veoh < Base 8 url_regex [%r!\Ahttp://www\.veoh\.com/videos/( [[:alnum:]]+)!,9 %r!\Ahttp://www\.veoh\.com/collection/\w+/watch/.*#watch%3[Dd]( [[:alnum:]]+)!,10 %r!\Ahttp://www\.veoh\.com/ collection/\w+/watch/([[:alnum:]]+)!]8 url_regex [%r!\Ahttp://www\.veoh\.com/videos/(v\d+[[:alnum:]]+)!, 9 %r!\Ahttp://www\.veoh\.com/collection/\w+/watch/.*#watch%3[Dd](v\d+[[:alnum:]]+)!, 10 %r!\Ahttp://www\.veoh\.com/(?:browse|collection)/(?:[\w]+/)+watch/(v\d+[[:alnum:]]+)!] 11 11 12 12 def scrape … … 19 19 @thumb_url = xml.match(/fullMedResImagePath="([^"]+)"/).to_a[1] 20 20 html = http_get(@page_url) 21 if embed_tag = html.match(/\sid="embed"\s[^>]*value="([^"]+)"/).to_a[1] 21 #logger.debug html 22 if embed_tag = html.match(/class="embedinput"\s[^>]*value="([^"]+)"/).to_a[1] 22 23 @embed_tag = CGI.unescapeHTML(embed_tag) 23 24 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)