2016-06-08 43 views
0

我一直在致力於一個項目,希望在過去的一年裏從instagram帖子中取消instagram帖子和評論信息。嘗試從instragram中刪除信息的錯誤

我現在就開始使用一個簡單的代碼來從單個用戶提取信息。

下面是代碼:

require(httr) 
full_url <- oauth_callback() 
full_url <- gsub("(.*localhost:[0-9]{1,5}/).*", x=full_url,  replacement="\1") 
print(full_url) 

app_name <- "Cognitive Model of the Customer" 
client_id <- "b03d4a910f0442b9bd1cd79fc06a086f" 
client_secret <- "c35f785784fa45cd9eaf786742ae9b3f" 
scope = "basic" 

instagram <- oauth_endpoint(
    authorize = "https://api.instagram.com/oauth/authorize", 
    access = "https://api.instagram.com/oauth/access_token") 
myapp <- oauth_app(app_name, client_id, client_secret) 

ig_oauth <- oauth2.0_token(instagram, myapp,scope="basic", type =  "application/x-www-form-urlencoded",cache=FALSE) 
tmp <- strsplit(toString(names(ig_oauth$credentials)), '"') 
token <- tmp[[1]][4] 
library(jsonlite) 
library(RCurl) 
user_info <- fromJSON(getURL(paste('https://api.instagram.com/v1/users/search? q=',"newbalance",'&access_token=',token,sep="")),unexpected.escape = "keep") 

我收到的錯誤是

Error in simplify(obj, simplifyVector = simplifyVector, simplifyDataFrame =  simplifyDataFrame, : 
    unused argument (unexpected.escape = "keep") 

我不知道我明白的地方這個錯誤來自不過。

+1

它來自您的最後一行。您將'unexpected.escape =「keep」'參數傳遞給JSON – tmpname12345

+0

可以通過什麼來修復錯誤?我需要那條線,對吧? –

回答

0

在運行代碼之前,您應該加載基本包。
請加載此包裝然後運行您的代碼:
庫(rjson)