我正在使用包rtweet
根据关键字下载推文。
成功工作超过2个月后,函数search_tweets()
返回错误。
现在它显示错误:
# load twitter library - the rtweet library is recommended now over twitteR
library(rtweet)
# plotting and pipes - tidyverse!
library(ggplot2)
library(dplyr)
# text mining library
library(tidytext)
# plotting packages
library(igraph)
library(ggraph)
cat ("Initializing.... \n")
Initializing....
cat("Enter a keyword whose analysis you want to check: ");
Enter a keyword whose analysis you want to check: > #a <- readLines("stdin",n=1) #doesnot work in Rstudio
a = "@realdonaldtrump"
src_tweets <- search_tweets(q = a, n = 1000,
+ lang = "en",
+ include_rts = TRUE)
Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, :
Unauthorized (HTTP 401).