Skip to content

Instantly share code, notes, and snippets.

@dpaola2
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpaola2/9653948 to your computer and use it in GitHub Desktop.
Save dpaola2/9653948 to your computer and use it in GitHub Desktop.
class Tweet < ActiveRecord::Base
def self.client
client = Twitter::REST::Client.new do |config|
config.consumer_key = ENV['TWITTER_KEY']
config.consumer_secret = ENV['TWITTER_SECRET']
end
client
end
def original
Tweet.client.status(self.twitter_id.to_i)
end
def oembed
Twitter::OEmbed.new(:id => self.original.id.to_i)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment