requirements.txt
from the original repo refused to work for me on Oracle Linux or Ubuntu Server 22.04. I've refined it by removing version requirements for certain dependencies. Hasn't broken for me yet, feel free to create an issue ticket if it does for you.
Documentation has been streamlined and improved for more concise instructions.
app.py
from the original repo, for some reason, commented out the send_to_slack(slack_text)
line required for sending the message to Slack. That's been uncommented.
Also have removed nonkeywords.csv
. I don't think it provides a very meaningful contribution to the code.
Tested on Ubuntu 22.04
- Install the latest version of Python and
pip
. - Clone this repository (
git clone https://github.com/AGaiki/foa-finder.git
) - Navigate into the folder and execute
pip install -r requirements.txt
(sometimes you might needpip3
depending on if you have an existing version of Python; Additionally, while this might not be the best practice, you might need to prepend that withsudo
if it complains about not being able to access or write to a specific directory, although running that in an environment will probably solve that). - Create your Slack app: https://api.slack.com/apps
- Navigate to the
Incoming Webhooks
page from the sidebar. - Activate the switch for Incoming Webhooks and create a new Webhook. Note the URL, you will need it for the next steps. You will also need to invite it to a Slack instance.
- Using your CLI text editor of choice, open
/etc/environment
and add a new line like so:SLACK_WEBHOOK_URL="SlackURL"
, replacingSlackURL
with the webhook link. - Edit
keywords.csv
to include whatever values you wish. I haven't changed the original repo owner's keywords, so make sure to remove and add whatever you wish in the same format as it. While, yes, csv does stand for "comma separated values," there are no commas in that document. That is by design. - Finally, run
python app.py
(orpython3 app.py
if there are multiple versions of Python installed). - Profit!
Modeling after the existing documentation from the original repo, I have set up cron jobs for 6:00PM daily:
- Run
crontab -e
on the CLI. It might ask you to pick a text editor. - Create a new line. In my case, I'd be inputting the following lines:
0 18 * * 1-7 python3 ~/foa-finder/app.py
. For help creating valid crontab syntax, please refer to this excellent tool: https://crontab.guru/#0_18_*_*_1-7. - Save.
- Profit!