← Back to Upcase

Integrating Twitter feed

(Anthony) #1

Hi, for my latest Rails project I need to integrate a Twitter feed (Twitter wall). I’ve never done this, so I could use some advice.

thanks a lot,

Anthony

0 Likes

(Ben Orenstein) #2

Step 1: Find a gem.
Step 2: Try it out.
Step 3: Let us know if you get stuck. :smile:

0 Likes

(Anthony) #3

ok, and do you know of any good gems for this?

0 Likes

(Ben Orenstein) #4

Haven’t had to do this myself, so no. But I’d just google around and look for one that’s actively maintained and has tests.

0 Likes

(khundawg) #5

I had looked into this gem recently for a potential project. Nothing to report yet, but at first glance it looked as if it would cover my needs.

0 Likes

(Anthony) #6

thanks khundawg,

this looks like a very elaborate gem. In fact all I need is to be able to show the tweets by one Twitter handle on a website.

greetings,

Anthony

0 Likes

(khundawg) #7

Looks like it’s just a connection and a request to get a timeline of posts from a user:

client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"
end

#Tweets by username
client.user_timeline("thoughtbot")
0 Likes

(Acandael Acandael) #8

yeah, that looks pretty easy. I’ll try it out and let you know.

Thanks again,

Anthony

0 Likes

(Lourens Van Der Jagt) #9

I could be missing something, but this sounds like a job for twitter’s timeline embeds: https://dev.twitter.com/web/embedded-timelines

1 Like

(Anthony) #10

Hi Lar,

That was easy as cake!

Thanks a lot!

Anthony

0 Likes