Created
January 29, 2015 15:10
-
-
Save danfrost/e4fe7aa36b1b250683ac to your computer and use it in GitHub Desktop.
News Whisperer
This file contains 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
#!/usr/bin/ruby | |
require 'rss' | |
require 'open-uri' | |
puts "Let me read you a story..." | |
strings = [] | |
url = 'http://feeds.bbci.co.uk/news/world/rss.xml' | |
open(url) do |rss| | |
feed = RSS::Parser.parse(rss) | |
feed.items.each do |item| | |
strings.push "#{item.title}" | |
end | |
end | |
string = strings.join ' ' | |
`say -r 20 -i -v Whisper \"#{string}\"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment