Twisplay
A little helper to display Tweets on your Rails website, taking Twitter's Design Guidelines into account. Tweet's are stored in your local database.
Installation
Add this line to your application's Gemfile:
gem 'twisplay'
And then execute:
$ rails g twisplay
$ rake db:migrate
Add the Twisplay CSS file 'application.css.scss':
@import "twisplay"
Usage
Configure Twitter gem during initialization:
Twitter.configure do |config|
config.consumer_key = TWITTER_CONSUMER_KEY
config.consumer_secret = TWITTER_CONSUMER_SECRET
config.oauth_token = TWITTER_ACCESS_TOKEN
config.oauth_token_secret = TWITTER_ACCESS_TOKEN_SECRET
end
Render a tweet in a view using the status id from the URL (E.g. https://twitter.com/#!/rubyonrails/status/186335852467728384 ):
<%= tweet "186335852467728384" %>
The result in your browser: