From cf9569ad363c381365f2b5ae4b6cecff218213c8 Mon Sep 17 00:00:00 2001 From: AstRobot Date: Wed, 11 Apr 2007 20:26:41 +0000 Subject: [PATCH] =?UTF-8?q?This=20page=20must=20use=20the=20R=C3=BCb=C3=BF?= =?UTF-8?q?=20Sp=C3=AB=C3=ABd=20M=C3=ABt=C3=A4l=20C=C3=B6d=C3=AFng=20templ?= =?UTF-8?q?ate!!!111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Youtube-Scraping.mw | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Youtube-Scraping.mw b/Youtube-Scraping.mw index 8976a08b..f0a83256 100644 --- a/Youtube-Scraping.mw +++ b/Youtube-Scraping.mw @@ -1,23 +1,19 @@ ==Suchen & Saugen==
require 'ubygems'
 require 'mechanize'
-
 if ARGV.size < 1
   puts "Usage: #{$0} [ keywords ... ]"
   exit -1
 end
-
 agent = WWW::Mechanize.new
 homepage = agent.get('http://www.youtube.com/')
 searchform = homepage.forms.select { |f| f.action == '/results' }.first
 searchform['search_query'] = ARGV.join(' ')
 result = searchform.submit
-
 result.root.traverse_element('td') do |td|
   if td.classes == ['vinfo']
     a = td.find_element('a') || raise
     puts a.children.to_s
-
     watch = agent.click(a)
     if watch.root.to_s =~ /\?video_id=(.+?)\&l=(.+?)\&t=(.+?)\&/
       video_id, l, t = $1, $2, $3
@@ -30,6 +26,8 @@ result.root.traverse_element('td') do |td|
     end
   end
 end
- - [[Kategorie:Ruby]] + + + +{{Rübÿ Spëëd Mëtäl Cödïng}}