A simple CLI to collect data from the Twitter stream API
pip install twcollectFirst, we need to specify the Twitter Bearer token to connect to the Twitter Stream API.
This needs to be specified in a YAML file (called credentials.yml by default) with the following format:
twitter_token: "<TWITTER_BEARER_TOKEN>"The collection can be started by calling the twcollect module.
python -m twcollect output_folderOr by using the Docker image (note we are mounting the credentials.yml and output_folder in the container):
docker run --rm -v $(pwd)/credentials.yml:/credentials.yml -v $(pwd)/output_folder/:/output_folder/ ghcr.io/smassonnet/twcollect:<VERSION> /output_folderNote that you need to replace <VERSION> by the latest available version of twcollect.
Please see the help for more options:
python -m twcollect --helpThis project has been set up using PyScaffold 4.3.1. For details and usage information on PyScaffold see https://pyscaffold.org/.