Skip to content

Instantly share code, notes, and snippets.

@chandresh
Created June 26, 2013 01:41
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 chandresh/5864099 to your computer and use it in GitHub Desktop.
Save chandresh/5864099 to your computer and use it in GitHub Desktop.
##just for playing with twitter api..
1. Create a App at: https://dev.twitter.com/apps/new
2. Get your Credentials
3. gem install 'twitter' or add it to your Gemfile
4. Then you can do something like this (Typically in your initializer):
Twitter.configure do |config|
config.consumer_key = 'nbnbmnbnbmn'
config.consumer_secret = 'nmn,mnmn,'
config.oauth_token = 'mn,mmn,'
config.oauth_token_secret = 'ghghjghj'
end
5. controller:
@tweets = Twitter.user_timeline("gem")
## typically you would want to save the records to the database
6. View:
<% @tweets.each do |tweet| %>
<%= tweet.text %><br/>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment