<commit_before># WPC-stream-bot
A bot for WPC to get the "top 3 streams" (currently these streams are chosen at random) and place them in the sidebar.

# Configuration
The bot is configured from a single ```config.json``` file, an example can be found in ```example_config.json```. It allows you to things like specify which data to pull mode, what reddit account to use and how to format the description.

# Running
Once you have filled out the ```config.json``` with a valid reddit account with moderator access to the wanted subreddit, you can safely execute the bot with ```python3 bot.py```.

<commit_msg>README: add information about configuration<commit_after># SideBar-Bot
A bot for WPC to get the "top 3 streams" (currently these streams are chosen at random) and place them in the sidebar.

# Configuration
There are two methods of configuring the SideBar-Bot, first using a JSON file, second using environment variables.

## JSON Configuration
In order to get started with JSON configuration, copy the ```example_config.json``` file to a new ```config.json``` file. Inside your new ```config.json``` you will be able to find basic documentation on how to use each available setting.

## Environment Variable Configuration
Environment variables are the recommended production setup. Translation between JSON configuration and environment variable configuration is relatively simple: replace ```_``` instead of ```.```'s and changeall letters to upper-case.

***note:*** if you are going to use environment variables, **ALWAYS** set ```ENV_MODE``` to anything other than None to enable it.

* ENV_MODE
* BOT_USERNAME
* BOT_PASSWORD
* MODE
* SUBREDDIT
* DEBUG
* TIMER
* DESCRIPTION_PRE
* DESCRIPTION_VIEWERS_TEMPLATE
* DESCRIPTION_TEMPLATE
* DESCRIPTION_POST

# Running
Once you have filled out the ```config.json``` with a valid reddit account with moderator access to the wanted subreddit, you can safely execute the bot with ```python3 bot.py```.


{'fraction_non_alphanumeric': 0.07963246554364471, 'fraction_numerical': 0.002041858090862685, 'mean_word_length': 5.030769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6282733', 'n_tokens_mistral': 514, 'n_tokens_neox': 501, 'n_words': 269}