Class: Net::IRC::MalaFav
- Inherits:
-
AsyncSession
- Object
- AsyncSession
- Net::IRC::MalaFav
- Defined in:
- lib/net/irc/mala.rb
Instance Method Summary collapse
Instance Method Details
#main_channel ⇒ Object
69 70 71 |
# File 'lib/net/irc/mala.rb', line 69 def main_channel "#malastream" end |
#on_new_thread ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/net/irc/mala.rb', line 73 def on_new_thread EM.run do api = "http://api.ma.la/home_timeline/stream/event" source = EventMachine::EventSource.new(api) source. do || begin status = JSON.parse() tweet = status["text"] screen_name = status['user']['screen_name'] post screen_name, PRIVMSG, main_channel, tweet rescue => ex STDERR.puts "error: #{ex.inspect}" next end end source.start # Start listening end end |
#server_name ⇒ Object
65 66 67 |
# File 'lib/net/irc/mala.rb', line 65 def server_name "malastream" end |