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.
Install this package from Github:
install.packages("devtools") library(devtools) install_github("marsha5813/botcheck") library(botcheck) # Load dependencies library(httr) library(xml2) library(RJSONIO)
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)
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.