bla
This commit is contained in:
@@ -47,6 +47,7 @@ api_params <- c(
|
||||
)
|
||||
|
||||
api_url <- "https://api.twitter.com/1.1/statuses/user_timeline.json";
|
||||
# api_url <- "https://api.twitter.com/1.1/statuses/show.json";
|
||||
user <- "peteraltmaier"
|
||||
max_count <- "200"
|
||||
max_id <- "999999999999999999"
|
||||
@@ -58,9 +59,11 @@ repeat {
|
||||
screen_name=user,
|
||||
count=max_count,
|
||||
max_id=max_id);
|
||||
# query <- c(trim_user="true", include_entities="false",
|
||||
# id="431858659656990721");
|
||||
if(exists("tweets_full")) {
|
||||
current <- twitter_api_call(api_url, query, api_params)
|
||||
tweets_temp <- fromJSON(correctJSON(current))
|
||||
tweets_temp <- fromJSON(current)
|
||||
tweets_temp <- tweets_temp[keep]
|
||||
tweets_full <- insertRow(tweets_full, tweets_temp)
|
||||
}
|
||||
|
||||
+10
-2
@@ -5,8 +5,16 @@ correctJSON <- function(string) {
|
||||
string <- str_replace_all(string, pattern = perl('\\\\(?![tn"])'), replacement = " ")
|
||||
string <- str_replace_all(string, pattern = "\n", replacement = " ")
|
||||
string <- str_replace_all(string, pattern = "\r", replacement = " ")
|
||||
string <- str_replace_all(string, pattern = "^", replacement = " ")
|
||||
\xed\xa0\xbd\xed\xb1\x8d\xed\xa0\xbd\xed\xb8\x8e\
|
||||
string <- str_replace_all(string, pattern = "\\^", replacement = " ")
|
||||
return(string)
|
||||
}
|
||||
|
||||
correctJSON2 <- function(string) {
|
||||
#string <- sub(x=string, pattern = perl('\\\\(?![tn"])'), replacement = " ")
|
||||
string <- gsub(x=string, pattern = "\n", replacement = " ")
|
||||
string <- gsub(x=string, pattern = "\r", replacement = " ")
|
||||
string <- gsub(x=string, pattern = "\\^", replacement = " ")
|
||||
#\xed\xa0\xbd\xed\xb1\x8d\xed\xa0\xbd\xed\xb8\x8e\
|
||||
return(string)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user