Created
November 15, 2009 16:32
-
-
Save fumokmm/235319 to your computer and use it in GitHub Desktop.
辞書サイトからランダムにキーワードを取得する(Wikipedia版)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://ja.wikipedia.org/wiki/特別:おまかせ表示 | |
def url = 'http://ja.wikipedia.org/wiki/%E7%89%B9%E5%88%A5:%E3%81%8A%E3%81%BE%E3%81%8B%E3%81%9B%E8%A1%A8%E7%A4%BA' | |
def html = new URL(url).getText('UTF-8') | |
def word = html.replaceAll(/(?s)^.+<title>| - Wikipedia<\/title>.+$/, '') | |
println word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment