Created
April 26, 2014 00:06
-
-
Save topher6345/11307570 to your computer and use it in GitHub Desktop.
Sample individual words of a reddit post
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' | |
site = 'http://reddit.com/r/showerthoughts/.xml' | |
doc = Nokogiri::HTML(open(site)) | |
filenames = [] | |
doc.css("title")[3].children.text.gsub(/"/, "").split(' ').each_with_index do |word, i| | |
filenames << i.to_s + word.to_s + ".aiff" | |
`say "#{word.to_s}" -o samples/#{i.to_s + word.to_s}.aiff -v Alex ` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment