A Python API for Truthy BotOrNot.
Behind the scenes, this uses the BotOrNot's REST endpoint as illustrated in this notebook.
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
}
}- Clone this repository and navigate to it with your terminal of choice.
python setup.py install
Both of these dependencies are available via pip, so you can install both at once with
pip install requests tweepy
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:
