0
代碼中的要點是從Facebook頁面收集帖子並將它們存儲在my_page中,但是我不熟悉代碼,因爲它是Uni項目的代碼。我遇到的問題是它必須以使用Rstudio創建的.rpres格式使用,因此我不想輸出,但仍需要運行代碼。停止Rfacebook循環輸出,同時仍然運行代碼
```{r, echo = FALSE}
#install.packages("Rfacebook")
include(Rfacebook)
token <- "Facebook dev auth token goes here"
page_name <- "BuzzFeed"
my_page <- getPage(page_name, token, n = 2,reactions = TRUE,api = "v2.10")
number_required <- 50
dates <- seq(as.Date("2017/07/14"), Sys.Date(), by = "day")
#
n <- length(dates) - 1
df_daily <- list()
for (i in 1:n){
cat(as.character(dates[i]), " ")
try(df_daily[[i]] <- getPage(page_name, token,
n = number_required,reactions = TRUE,api = "v2.10",
since = dates[i],
until = dates[i+1]))
cat("\n")
}
```