2007-05-06から1日間の記事一覧

Yahooから株価情報を取得 #2

書き直した。正規表現の%記法である%rを使ってみた。 require 'net/http' require 'kconv' class YahooInfo @@regexes = { :name=> '<td nowrap>&nbsp;<b>(.*?)</b>', :exchange=> '</b>&nbsp;<b>【</b>(.*?):<b>', :price=> '取引値<br>.*?<b>(.*?)</b>', :volume=> '<td nowrap>出来高<br>(.*?)</td>', :capital=> '<td nowrap>時価総</td></b>…