Skip to content

Instantly share code, notes, and snippets.

@mattjbarlow
Last active December 31, 2015 23:40
Show Gist options
  • Save mattjbarlow/8060998 to your computer and use it in GitHub Desktop.
Save mattjbarlow/8060998 to your computer and use it in GitHub Desktop.
class TweetSearch < ActiveRecord::Base
attr_accessible :status, :tweet_id, :user
def self.query(search_item="pizza")
starttime = Time.now
result = Twitter.search(search_item, :count => 10, :result_type => "recent").results.first
tweettime = ((Time.now - starttime) * 1000).to_i
METRICS.timing('tweetsearch.query', tweettime)
return result
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment