Created
June 26, 2013 01:41
-
-
Save chandresh/5864099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##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