#!/usr/bin/ruby
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
require 'twitter'
source = "http://groups.google.co.jp/group/ruby-tokai/feed/rss_v2_0_msgs.xml"
content = ""
open(source) do |s| content = s.read end
rss = RSS::Parser.parse(content, false)
twit = Twitter::Base.new("babydaemons@gmail.com", "rubytokai123")
print "RSS title: ", rss.channel.title, "\n"
print "RSS link: ", rss.channel.link, "\n"
print "title of first item: ", rss.items[0].title, "\n"
print "link of first item: ", rss.items[0].link, "\n"
print "description of first item: ", rss.items[0].description, "\n"
print "date of first item: ", rss.items[0].date, "\n"
message = rss.items[0].title + ' ' + rss.item[0].link
p message
twit.post message