简体   繁体   English

在Rails应用程序中使用Twitter API显示选定的用户推文

[英]Display a chosen users tweets using twitter api in a rails app

I am trying to display a chosen users tweets in my rails app. 我正在尝试在我的rails应用程序中显示选定的用户推文。 Right now the way I have it, it is pulling up their tweets and any time they are mentioned. 就我现在所知,它正在拉动他们的推文以及任何时候被提及。 I just want the tweets that they post and nothing else. 我只想要他们发布的推文,别无其他。 I will not have their log in info. 我将没有他们的登录信息。 This will just work for public accounts. 这仅适用于公共帐户。 This is the code I have so far. 这是我到目前为止的代码。

client.search(user_id=@band.twitter).take(20).collect do |tweet|

the @band.twitter is where I am storing the bands twitter handle. @ band.twitter是我存储乐队推特句柄的地方。 Any help would be much appreciated. 任何帮助将非常感激。

这似乎为我工作。

client.user_timeline(@band.twitter).take(20).collect do

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM