func.4 objects

進捗しない日記 プログラミングとか

ワンライナーで青空文庫検索

しょぼくても更新した方が良いなぁと思ったので。

#coding : utf-8
require 'net/http'
require 'open-uri'
require 'httpclient'

p (HTTPClient.new).get_content("https://www.google.com/search?hl=ja&lr=lang_ja&ie=utf-8&num=20&complete=0&as_dt=i&as_sitesearch=www.aozora.gr.jp&as_q=#{gets.chomp}").scan(/http:\/\/www.aozora.gr.jp\/cards\/\d{0,10}\/card\d{0,10}.html/).uniq

おしまい!