qykong / botcheck

Makes a call to the Botometer API in R to obtain the probability that a specified Twitter handle is a bot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# botcheck

botcheck makes a call to the [Botometer API](https://botometer.iuni.iu.edu/#!/) 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:

```{r, eval=FALSE}
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](https://market.mashape.com/OSoMe/botometer). Save your key by replacing the "xxxx" placeholders.

```{r, eval=FALSE}
Mashape_key = "xxxxxxxxxxxxxxxxxx"
```

You'll also need to create and register a [Twitter app](https://apps.twitter.com/). Save your keys by replacing the "xxxx" placeholders.

```{r, eval=FALSE}
consumer_key = "xxxxxxxxxxxxxxx"
consumer_secret = "xxxxxxxxxxxxxxx"
access_token = "xxxxxxxxxxxxxxx"
access_secret = "xxxxxxxxxxxxxxx"
```

Finally, store the Twitter authorization info.

```{r, eval=FALSE}
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:

```{r, eval=FALSE}
botcheck("barackobama")
```




About

Makes a call to the Botometer API in R to obtain the probability that a specified Twitter handle is a bot.

License:Other


Languages

Language:R 100.0%