Skip to content

Instantly share code, notes, and snippets.

@itkq
Created July 22, 2016 05:53
Show Gist options
  • Save itkq/8d13f95518ff0d1b7fee7f48b2d627cd to your computer and use it in GitHub Desktop.
Save itkq/8d13f95518ff0d1b7fee7f48b2d627cd to your computer and use it in GitHub Desktop.
ポケモン151匹の正規表現取得ワンライナー
ruby -rmechanize -e 'm=Mechanize.new;m.get "https://ja.wikipedia.org/wiki/%E5%85%A8%E5%9B%BD%E3%83%9D%E3%82%B1%E3%83%A2%E3%83%B3%E5%9B%B3%E9%91%91%E9%A0%86%E3%81%AE%E3%83%9D%E3%82%B1%E3%83%A2%E3%83%B3%E4%B8%80%E8%A6%A7";puts "("+m.page.search("table")[0].css("td/a").map{|a|a.text}.join("|")+")";'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment