A package to programmatically query a twitter user on BotSentinel
Project description
PyBotSentinel
PyBotSentinel is an API wrapper for BotSentinel. It's simple in functionality as at this point, it only provides you a rating, and the description of what that rating means to BotSentinel.
Requirements
This requires Python 3.6 and above, and was built on Python 3.8. It requires requests, ScraPy
Installation
I recommend you install this via pip3 (PyPi)
$ pip3 install pybotsentinel
Getting Started and Finished
import pybotsentinel
query = pybotsentinel.PyBotSentinel()
rating = query.get_bot_rating('realdonaldtrump')
>>> rating
[True, 30, 'Moderate', 'Our analysis has concluded realdonaldtrump exhibits moderate tweet activity and is not a trollbot account.']
Troubleshooting
If you end up getting an occasional 403 while querying, it's most likely due to a race condition as a result of making the GET request to the page to get the one-time-key for BotSentinel's backend API, the next key generates before the POST call is made, the POST call to the API is made, and the API returns a JSON object of {'success': False, 'bot_rating': 'INCORRECT_DATA'} with a HTTP status code code of 403. If a subsequent query is made for the same user, it will succeed and return the user's bot rating.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for pybotsentinel-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee2674c7daedcc4c1f3dbcbae8600b2375a63945e1336d1fc1314959292d03a1 |
|
MD5 | 4cf47ee6ab7a2746424b3d75762fe567 |
|
BLAKE2b-256 | 2db6b550ba89c6223b1a738a90c128c431b4c43077f4b93ab7ec0ce640999dd2 |