æºå¸¯ãã£ãªã¢ããµã¤ããä½ã«ã«ãã´ã©ã¤ãºãã¦ããåããã¹ã¯ãªãã
require "rubygems" require "net/http" require "uri" require "nkf" require "nokogiri" uri = URI.parse("http://category.netstar-inc.com/check/res.php") Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Post.new(uri.path) request["user-agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)" request.set_form_data({:url => ARGV[0]}) html = Nokogiri(NKF::nkf("-w -m0", http.request(request).body)) html.search(".result_text").each do |result| print result.inner_html end end
å ¥å
ruby categorize.rb http://gree.jp
åºå
â 確èªããURLhttp://gree.jpâ åé¡çµæ大ã«ãã´ãªãã³ãã¥ãã±ã¼ã·ã§ã³<br>å°ã«ãã´ãªãæ²ç¤ºæ¿<br>