Skip to content

Instantly share code, notes, and snippets.

@dylanerichards
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save dylanerichards/ca660baa675c7eb23525 to your computer and use it in GitHub Desktop.

Select an option

Save dylanerichards/ca660baa675c7eb23525 to your computer and use it in GitHub Desktop.
Twitter Feed
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
gem 'twitter'
<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