Skip to content

Instantly share code, notes, and snippets.

@danfrost
Created January 29, 2015 15:10
Show Gist options
  • Save danfrost/e4fe7aa36b1b250683ac to your computer and use it in GitHub Desktop.
Save danfrost/e4fe7aa36b1b250683ac to your computer and use it in GitHub Desktop.
News Whisperer
#!/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