botcheck

botcheck makes a call to the Botometer API and returns the probability that a specified Twitter user is a bot. Higher probability scores are more bot-like.

Installation

Install this package from Github:

install.packages("devtools")
library(devtools)
install_github("marsha5813/botcheck")
library(botcheck)

# Load dependencies
library(httr)
library(xml2) 
library(RJSONIO)

Setup

You must first get your own Botometer API key. Save your key by replacing the "xxxx" placeholders.

Mashape_key = "xxxxxxxxxxxxxxxxxx"

You'll also need to create and register a Twitter app. Save your keys by replacing the "xxxx" placeholders.

consumer_key = "xxxxxxxxxxxxxxx"
consumer_secret = "xxxxxxxxxxxxxxx"
access_token = "xxxxxxxxxxxxxxx"
access_secret = "xxxxxxxxxxxxxxx"

Finally, store the Twitter authorization info.

myapp = oauth_app("twitter", key=consumer_key, secret=consumer_secret)
sig = sign_oauth1.0(myapp, token=access_token, token_secret=access_secret)

Use

Call the botcheck() function to get the probability that a Twitter handle is a bot. Importantly, do not put the "@" before the Twitter user's name. For example:

botcheck("barackobama")


marsha5813/botcheck documentation built on May 29, 2019, 3:44 a.m.