Skip to content

Commit

Permalink
Move botscan To Streaming API
Browse files Browse the repository at this point in the history
Botscan now defaults to Twitter's streaming API, leaving the option to use the search API.
  • Loading branch information
kurtawirth committed Nov 6, 2018
1 parent 643abe0 commit 62c2a76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: botscan
Type: Package
Title: Scans Twitter Conversations For Bots
Version: 1.0.4
Version: 1.0.5
Author: Kurt Wirth and Ryan T. Moore
Maintainer: Kurt Wirth <KurtAWirth@gmail.com>
Description: This package accepts any Twitter search query as an input and
Expand Down
14 changes: 11 additions & 3 deletions R/botscan.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,18 @@
#'
#' @export

botscan <- function(x, n_tweets = 1000, retweets = FALSE, threshold = 0.899,
user_level = FALSE, verbose = TRUE) {
botscan <- function(x, timeout = 30, n_tweets = 1000, retweets = FALSE, threshold = 0.899,
user_level = FALSE, search = FALSE, parse = TRUE, verbose = TRUE) {

tweets <- rtweet::search_tweets(x, n = n_tweets, include_rts = retweets)
if(search) {

tweets <- rtweet::search_tweets(x, n = n_tweets, include_rts = retweets)

} else {

tweets <- rtweet::stream_tweets(x, timeout = timeout, parse = parse)

}

# Take the usernames and turn them into a vector

Expand Down

0 comments on commit 62c2a76

Please sign in to comment.