This project is a Twitter Bot for the Wikitrans website which allows any user to perform a request from Twitter.
The available commands are the following :
Below is an example of a request to look for an article with the keywords "numéro de sécurité sociale" on the Wikitrans website.
A configuration template is provided in the repo. You can find it at the root of the project with the name config_template.json
.
You can find different sections:
twitter
twitter_api_key
: your Twitter API keytwitter_api_key_secret
: your Twitter API key screttwitter_access_token
: your Twitter access tokentwitter_access_token_secret
: your Twitter access token secrettwitter_bearer_token
: your Twitter bearer tokenuser_id
: the user ID of your accountlast_id_file
: the path to the file where the last checked tweet id (called since_id) is storedsleep_time
: the time between two runs, in seconds (60 is strongly adviced)trigger_keyword
: the keyword to use to ask the bot an articlelogfile_path
: the path to the logfilestop_words
: a list of words to ignore when performing a searchThey are configured in the command_handlers
section.
You define a command handler section with the name of the class of the handler.
Every command handlers must at least define :
module
: the path to the module of the handleraliases
: the list of keywords to trigger the handlerMore configuration can be put in a handler section as needed, (i.e. : templates for the answers)