Report abuse

Think Geek Code (controller) [ruby]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def thinkGeek

  require 'rss'

  rss = RSS::Parser.parse(open('http://www.thinkgeek.com/xml/app/wishlist/id/<youridhere>').read, false)
  @output = "<p style='text-align: center;font-size: 110%; font-weight: bold;'>" + rss.channel.description + "</p>"
  @output += "<ul id='thinkgeek_update_list'>"

  rss.items.each_with_index do |item,i|
   @output += "<li><a href='" + item.link + "' title='" + cleanStr(item.title) + "'>" + item.title + "</a><br/><a target='_' class='timeStamp' href='" + item.link + "'></a></li>"
  end
  @output += "</ul>"

  rescue 
   @output = 'Uh oh!  Seems like something is wrong.. Try again later.'
  return @output
end