kurtawirth / botscan

R tool for scanning Twitter for bot activity on a conversation level.
GNU General Public License v3.0
10 stars 6 forks source link

Adapt botscan to use Python's botometer #8

Closed ryantmoore closed 5 years ago

ryantmoore commented 6 years ago

We are adapting botscan to use botometer in Python to describe accounts, defined by handles. As of commit e5cb877, we can check single accounts. After devtools::build() and install(), we have a working version. check() returns 2 NOTES, one that a Python-created function isn't defined globally (but it works), and 1 ERROR from failing the old unit tests (no surprise, given that I never stored the keys appropriately for that test). Substituting real keys for "a", ..., "e" and a real Twitter handle for @my_handle below, we get botometer estimates.

my_bom <- setup_botscan("a", "b", "c", "d", "e")

my_bom$check_account("@my_handle")
ryantmoore commented 6 years ago

As of commit 9f809e7c5083e9c91d0dabb521cf1feffd9cec98, the Python code is integrated into the package and the structure above works.

ryantmoore commented 6 years ago

botscan() currently uses a not-botometer package. The next thing to do is adapt the code there to use botometer. In particular, line 40 is

userbots <- botrnot::botornot(tweets, fast = TRUE)

This should be updated to implement a loop over the handles that the function from rtweets has pulled.

kurtawirth commented 5 years ago

This is now working successfully.