Skip to content

Instantly share code, notes, and snippets.

@maricris-sn
Created October 23, 2010 09:19
Show Gist options
  • Save maricris-sn/641989 to your computer and use it in GitHub Desktop.
Save maricris-sn/641989 to your computer and use it in GitHub Desktop.
## Think Geek Code (controller) [ruby]
def thinkGeek
require 'rss'
rss = RSS::Parser.parse(open('http://www.thinkgeek.com/xml/app/wishlist/id/').read, false)
@output = "" + rss.channel.description + ""
@output += ""
rss.items.each_with_index do |item,i|
@output += "" + item.title + ""
end
@output += ""
rescue
@output = 'Uh oh! Seems like something is wrong.. Try again later.'
return @output
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment