问题描述
限时送ChatGPT账号..我是 R 和 twitteR 软件包的新手,但我找不到有关如何完成以下内容的强烈建议.
I'm a novice R and twitteR package user but I wasn't able to find a strong recommendation on how to accomplish the following.
我想挖掘少量 Twitter 帐户,以确定它们的关键字使用输出.(即我还不知道关键字是什么)
I'd like to mine a small number of twitter accounts to identify their output for keyword usage. (i.e. I don't know what the keywords are yet)
假设:
我有少量推特帐户 (<6) 如果您汇总各种帐户状态,我想最多挖掘 7000 条推文这些帐户并没有以很快的速度生成新的推文(一些天)根据lookupUsers()
返回的个人资料数据,这些账户的推文都少于3200条
I have a small number of tweeter accounts (<6) I want to mine with a max of 7000 tweets if you aggregate the various account statuses
Those accounts are not generating new tweets at a fast rate (a few a
day)
The accounts all have less than 3200 tweets according to the profile data returned by lookupUsers()
当我使用 twitteR 函数时 userTimeline("accountname", n=3200)
我得到了 40 到 600 个返回的观察值,即没有接近 3200.我知道有 API 限制,但如果它是一个限制问题,我希望得到相同数量的观察结果或收到通知我需要等待 15 分钟
When I use the twitteR function userTimeline("accountname", n=3200)
I get between 40 and 600 observations returned i.e no where near the 3200. I know there are API limits but if it was an issue of limits I would expect to get the same number of observations back or get the notice that I need to wait 15 mins
如何在玩得开心的同时获得我需要的所有文本?
How do I get all the text I need while still playing nice ?
推荐答案
通过使用 cran 和 github 包的组合,可以获得用户的所有推文
By using a combination of cran and github packages it was possible to get all the tweets for a user
使用的包是 cran 中的 streamR 和 https://github/SMAPPNYU/smappR/ 帮助分析和获取推文.
The packages used were streamR available in cran and https://github/SMAPPNYU/smappR/ to help with the analysis and getting the tweets.
基本步骤是
使用 oauth 和您的 twitter 密钥、令牌和机密对 twitter 进行身份验证使用 smappR 函数 getTimeline() 将推文保存到您指定的 json 文件中 使用 parseTweets(jsonfile) 将 json 内容读入数据帧这篇关于twitteR r 包:如何在 API 限制内为每个帐户获取尽可能多的推文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论