Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybotsentinel-0.0.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file pybotsentinel-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pybotsentinel-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for pybotsentinel-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1dc59eb371508d3242d91b6b7332b6f0e8ecaa990d6fb00ae46e91cd1dbc8f7f
MD5 4c49f83de44b6c4593ba7e744b7501b7
BLAKE2b-256 1c31546f04e94ee835f0e89f9d377813b5f9ce52af8af2e9cc6d98bfaa8db391

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page