Skip to content

Instantly share code, notes, and snippets.

@levycarneiro
Created March 13, 2009 13:37
Show Gist options
  • Save levycarneiro/78563 to your computer and use it in GitHub Desktop.
Save levycarneiro/78563 to your computer and use it in GitHub Desktop.
class Tweet < ActiveRecord::Base
Tweet_identificator = 'protip:'
def self.fetch_new_tweets
Twitter::Search.new.
containing(Tweet_identificator).
not_retweeted.
since(last_id_processed).
fetch
end
def self.last_id_processed
Tweet.last.object_id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment