Skip to content

SyraD/botornot-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BotOrNot Python API

A Python API for Truthy BotOrNot.

Behind the scenes, this uses the BotOrNot's REST endpoint as illustrated in this notebook.

Quickstart

import botornot

twitter_app_auth = {
    'consumer_key': 'xxxxxxxx',
    'consumer_secret': 'xxxxxxxxxx',
    'access_token': 'xxxxxxxxx',
    'access_token_secret': 'xxxxxxxxxxx',
  }
bon = botornot.BotOrNot(**twitter_app_auth)

bon.check_account('@clayadavis')

Result:

{
  "score": 0.37,
  "meta": {"screen_name": "clayadavis", "user_id": "1548959833"},
  "categories": {
    "content_classification": 0.27,
    "friend_classification": 0.15,
    "network_classification": 0.17,
    "sentiment_classification": 0.25,
    "temporal_classification": 0.43,
    "user_classification": 0.36
  }
}

Install instructions

  1. Clone this repository and navigate to it with your terminal of choice.
  2. python setup.py install

Dependencies

Python dependencies

Both of these dependencies are available via pip, so you can install both at once with

pip install requests tweepy

Twitter app

In order to access Twitter's API, one needs to have/create a Twitter app. Once you've created an app, the authentication info can be found in the "Keys and Access Tokens" tab of the app's properties: Screenshot of app "Keys and Access Tokens"

About

A Python API for Truthy BotOrNot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%