Created
April 23, 2010 01:56
-
-
Save lifo/376066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cramp/controller' | |
require 'cramp/model' | |
require 'twitter' | |
module Twisocket | |
class Socket < Cramp::Controller::Websocket | |
before_start :set_twitter | |
# Probably cramp should fire all the timer methods before scheduling them via EM periodic timers | |
on_start :check_tweets | |
periodic_timer :check_tweets, :every => 30 | |
def set_twitter | |
@twitter = Twitter.user('dmathieu') | |
end | |
def check_tweets | |
render @twitter.status.text | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment