开发者

Displaying Twitter Status Ouath

开发者 https://www.devze.com 2023-03-01 16:34 出处:网络
This is probably a stupid question but I cannot find the answer anywhere. I\'ve got my application connected to twitter (and a few others) via oauth / oauth-plugin.

This is probably a stupid question but I cannot find the answer anywhere.

I've got my application connected to twitter (and a few others) via oauth / oauth-plugin.

The token and secret are stored in the db.

My problem is that I have no idea how to display the information, status etc. in my views. Have tr开发者_如何学编程ied a few things but can't figure it out and don't know what to look for.

thanks in advance, again.

// UPDATE //

I realise now that I need something in my user.rb model to connect. Found this online but don't know how to update for my scenario

def twitter
  unless @twitter_user
    provider = self.authentications.find_by_provider('twitter')
    @twitter_user = Twitter::Client.new(:oauth_token => provider.token, :oauth_token_secret => provider.secret) rescue nil
  end
  @twitter_user
end

My token and secret are store in consumer_tokens and my provider details are in the oauth initialiser.

Can anyone advise what I should do?

Thanks


If i m understanding properly. you want to fecth user's tweet, then here is the solution.

http://rubyonrailshacks.com/how-to-implement-the-simplest-way-to-fetch-friends-timeline-streams-from-twitter-in-ruby-on-rails/

Also if you want to fetch facebook you can must check this:--

http://rubyonrailshacks.com/how-to-fetch-and-show-the-user-stream-from-facebook-via-facebook-connect/

0

精彩评论

暂无评论...
验证码 换一张
取 消