- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
似乎使用 tweepy 我只能使用 user_timeline 方法获得 200 条推文。
class Twitter_User():
def __init__(self,id,count=200):
self.id = id
self.count = count
self.data = None
def get_tweets(self):
store_tweets = api.user_timeline(self.id, count=self.count)
simple_list = []
for status in store_tweets:
array = [status._json["text"].strip(), status._json["favorite_count"], status._json["created_at"],status._json["retweet_count"],[h["text"] for h in status._json["entities"]["hashtags"]]]
simple_list.append(array)
self.data = pd.DataFrame(simple_list, columns=["Text", "Like", "Created at","Retweet","Hashtags"])
self.data = self.data[~self.data["Text"].str.startswith('RT')]
return self.data
def __repr__(self):
id = api.get_user(self.id)
return id.screen_name
如果我将大于 200 的数字作为 self.count,我总是会得到一个包含 200 行的数据框,相反,如果我输入较小的数字,我会得到正确的行数。我不知道,有限制还是我必须使用其他方法?
最佳答案
一次请求最多只能获得 200 条推文。但是,您可以连续请求旧推文。一条时间线中最多可获取的推文数量为 3200。引用为 here .
您可以使用 tweepy 执行此操作,但您需要使用 tweepy 的 Cursor 获取这些连续的推文页面。看this让你开始。
关于python - tweepy api.user_timeline : count limited to 200,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46734636/
在我们网站的新闻页面上,我们使用 Twitter 的 GET statuses/user_timeline API 端点为我们显示的 8 个新闻故事的每个 Ajax 页面提取 4 条推文,在结果网格中
我在将 Twitter API 集成到我的网站以制作我最新推文的一小部分时遇到问题。我使用此 URL 调用 JSON API: http://twitter.com/statuses/user_tim
需要一些帮助的人。现在,我可以在没有 Twitter 帐户的情况下成功获得单个用户时间线。但是我不知道如何在一个请求中获取多个用户时间线。实际上我只需要通过一个请求获得 3 个用户时间线。有什么帮助吗
已解决 问题是 Twitter 现在(愚蠢地)甚至对于公共(public)数据也需要 OAuth。一个足够简单的解决方法是使用本地 php 脚本进行 OAuth 并获取数据并使用 Ajax 访问数据,
我有一个应用程序,让用户通过 Twitter 进行身份验证,并让我的应用程序访问他们的 Twitter 帐户。为此,他们单击前端的一个按钮,前端通过使用应用程序信息访问 Twitter 来获取服务器上
除了已经返回的 favorite_count 和 retweet_count 之外,还有什么方法可以使用 GET statuses/user_timeline 获取推文的评论/回复计数? 谢谢! 最佳
我之前使用过一些 jQuery 来阅读 twitter 上的推文: $.ajax('https://api.twitter.com/1/statuses/user_timeline.json', {
使用 Twitter API,我可以获得所有用户的带有位置信息的推文。如果他们使用移动应用程序并附加照片,我如何从 API 获取该照片? 最佳答案 首先,您需要包含 include_entities=
你可能认为这是一个显而易见的问题,我不必问,但显然我这样做,因为在 documentation for this 中他们说了两件看似矛盾的事情。第一: This method can only ret
我正在为大量用户收集推文,因此该脚本将在无人监督的情况下运行数天/数周。我在 big_list 中有一个 user_id 列表。我认为一些推文是私有(private)的,我的脚本停止了,所以我想要一种
我使用 Bobby's answer获取Twitter的用户时间线,代码非常简单易懂,我在Windows/.NET 4.5下试过,效果很好。 但是当我尝试使用完全相同的代码在 Ubuntu/Mono
我正在使用 tweepy 使用包含的脚本从用户的时间轴中获取推文 here .然而,这些推文被截断了: auth = tweepy.OAuthHandler(consumer_key, consume
下面的 PHP 代码曾经工作然后今天早上突然调用了下面的代码 $get_tweets = $connection->get("https://api.twitter.com/1.1/statuses/
我希望提取推文中存在的外部 URL 的值。加上生成的该 URL 的缩略图。 示例推文: http://prntscr.com/ogdqey https://twitter.com/JarirBooks
似乎使用 tweepy 我只能使用 user_timeline 方法获得 200 条推文。 class Twitter_User(): def __init__(self,id,count=2
我正在为 android 制作一个应用程序,其功能之一是推文列表,我读取 Twitter api 请求的 json 警报的推文,我使用的是 1.0 版本的 api,但是每小时请求数限制为 150,很容
我一直在尝试实现 Fabric 以从用户那里获取 5 条最新推文的列表。它工作了几个小时,然后就停止工作了。我想在没有用户登录的情况下执行此操作,据我所知,API 允许访客登录阅读推文,但这可能对速率
前一段时间我有这个代码来放置用户的最后 3 条推文: jQuery.getJSON("http://twitter.com/statuses/user_timeline/"+ user +".json
由于 Twitter API 1.0 于 2013 年 6 月 11 日停用,我的旧脚本不再有效。 如何以尽可能少的编码获取 user_timeline(最近的状态)? 最佳答案 使用 Jason 提
我正在尝试创建一个包含 twitter api、facebook api 和 instagram api 的表的数据库。 这是我尝试过的 foreach($string as $items)
我是一名优秀的程序员,十分优秀!