Last active
August 29, 2015 14:06
-
-
Save dylanerichards/ca660baa675c7eb23525 to your computer and use it in GitHub Desktop.
Twitter Feed
This file contains hidden or 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
| before_filter :authenticate_twitter_account, :load_tweets | |
| def authenticate_twitter_account | |
| require 'twitter' | |
| @client = Twitter::REST::Client.new do |config| | |
| config.consumer_key = "1xStTkPEJ0P9lfbq4nxbiGVTb" | |
| config.consumer_secret = "MQRHDJMQxSq5IwuDQr2KNmYVeAYP2J8hVyezNXnwkP5FA6A6WI" | |
| config.access_token = "1666885086-vr8l8e3ivrpmurzmwvyy96sbb8kfqran2thcj80" | |
| config.access_token_secret = "kE68FLaixOov4A7bEgw1EtVHJ5hinDyEcSo6dKPVrSx4T" | |
| end | |
| end | |
| def load_tweets | |
| @tweets = @client.user_timeline | |
| end |
This file contains hidden or 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
| gem 'twitter' |
This file contains hidden or 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
| <ul> | |
| <% @tweets.each do |tweet| %> | |
| <li><%= tweet.text %></li> | |
| <% end %> | |
| </ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment