Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #85 from cjbarrie/justin-dev
Browse files Browse the repository at this point in the history
Fix isFALSE issue for R > 3.4.2
  • Loading branch information
justinchuntingho authored May 25, 2021
2 parents ebb6cf5 + 8751531 commit 7d266dc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 303 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
export(bind_tweet_jsons)
export(bind_user_jsons)
export(build_query)
export(build_user_query)
export(get_all_tweets)
export(get_bbox_tweets)
export(get_country_tweets)
Expand Down
2 changes: 1 addition & 1 deletion R/build_queryv2.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ build_query <- function(query,
query <- paste(query, "is:retweet")
}

if(isFALSE(is_retweet)) {
if(!isTRUE(is_retweet)) {
query <- paste(query, "-is:retweet")
}

Expand Down
200 changes: 0 additions & 200 deletions R/build_user_queryv2.R

This file was deleted.

80 changes: 0 additions & 80 deletions man/build_user_query.Rd

This file was deleted.

29 changes: 8 additions & 21 deletions vignettes/academictwitteR-build.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -302,33 +302,20 @@ query
```

## Building user queries with `build_user_query()`
## Building user queries with `get_user_tweets()`

What if we had a number of users in which we were interested but we weren't interested in all of their tweets? Say we wanted only to collect tweets that weren't retweets but contained images, and that were in the English language?

We can achieve this by building a query with `build_user_query` and passing the resulting character vector of users and parameters to the `get_user_tweets()` function as follows:

```{r}
users <- c("cbarrie", "justin_ct_ho")
users_params <-
build_user_query(users,
is_retweet = F,
has_media = T,
lang = "en")
users_params
```


We would then enter our new vector of users with added parameters to the `get_user_tweets()` function as follows:
We can achieve this by building a query with `get_user_tweets()`, the fuction will turn a character vector of users into a query and pass to the `get_all_tweets()` function along with other parameters:

```{r, eval=FALSE}
users <- c("cbarrie", "justin_ct_ho")
tweets <-
get_user_tweets(users_params,
get_user_tweets(users,
"2018-01-01T00:00:00Z",
"2020-04-05T00:00:00Z",
bearer_token)
bearer_token,
is_retweet = FALSE,
has_media = TRUE,
lang = "en")
```

0 comments on commit 7d266dc

Please sign in to comment.