Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'twitter'
- require 'socket'
- # These are the series of connections, first to the MUSH and then to Twitter.
- twitconnect = TCPSocket.new('birdsofwar.ginkosoft.com',1940) # Connect to the MUSH here.
- twitconnect.puts "connect twit 123123" # Connect to the account here.
- httpauth = Twitter::HTTPAuth.new('thinkwritemute@gmail.com', 'thinkmute') # Connect to Twitter here.
- base = Twitter::Base.new(httpauth) # Continued connection to twitter.
- while line = twitconnect.readline
- line.chomp! # Get rid of trailing \r\n
- case line
- when /^\[Public\] (.*) says, "(.*)"/ # This is the regexp that matches the channel header.
- base.update("#{$1}: #{$2}") # This is what sends to twitter.
- when /^<Public> (.*) says, "(.*)"/ # And for Penn...
- base.update("#{$1}: #{$2}")
- end
- end
Add Comment
Please, Sign In to add comment