Guest User

Untitled

a guest
Jun 22nd, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. require 'rubygems'
  2. require 'twitter'
  3. require 'socket'
  4. # These are the series of connections, first to the MUSH and then to Twitter.
  5.  
  6. twitconnect = TCPSocket.new('birdsofwar.ginkosoft.com',1940) # Connect to the MUSH here.
  7. twitconnect.puts "connect twit 123123" # Connect to the account here.
  8. httpauth = Twitter::HTTPAuth.new('thinkwritemute@gmail.com', 'thinkmute') # Connect to Twitter here.
  9. base = Twitter::Base.new(httpauth) # Continued connection to twitter.
  10.  
  11. while line = twitconnect.readline
  12. line.chomp! # Get rid of trailing \r\n
  13. case line
  14. when /^\[Public\] (.*) says, "(.*)"/ # This is the regexp that matches the channel header.
  15. base.update("#{$1}: #{$2}") # This is what sends to twitter.
  16. when /^<Public> (.*) says, "(.*)"/ # And for Penn...
  17. base.update("#{$1}: #{$2}")
  18. end
  19. end
Add Comment
Please, Sign In to add comment