Created
June 23, 2013 02:36
-
-
Save namiwang/5843518 to your computer and use it in GitHub Desktop.
get random words from matrix67's idea generator
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
require 'nokogiri' | |
require 'open-uri' | |
50.times do | |
page = Nokogiri::HTML(open("http://www.matrix67.com/ideagen/")) | |
word = page.css('body .main p').children[0].to_s.gsub("\r",'').gsub("\n",'').gsub("\t",'').split('的')[1] | |
File.open('words','a'){ |file| file.write(word+"\n") } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment