A reddit search bot I created that searches a specific subreddit for keywords. It will message an account with a listing of what has been found. This can be useful for watching for posts. Personally I am using it to check r/watchexchange for watches that I want and notify me when they are listed.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See usage/deployment for notes on how to deploy the project on a live system.
pip install praw
Depending on your system you may need to do
pip3 install praw
You will need a praw.ini
file with the following information:
[watcher]
client_id=<Your reddit client id>
client_secret=<Your reddit secret>
username=<Yours or your bot's reddit username>
password=<Yours or your bot's reddit password>
To obtain a client id and secret you will need to register your app with reddit. Notify them here.
You will also need a config.json
file with the following structure:
{
"search_strings": ["<array of strings you want to search for>"],
"search_category": "<Name of what you are searching for (for message formatting)>"
"user": "<the username of the person you want to message>",
"subreddit": "<the subreddit you want to search>",
"time_filter": "<what time frame you want to search for>"
}
This script can be run manually. Alternatively you can execute it programmatically, for example as a cronjob. I personally am running it on a Digital Ocean droplet as a cronjob once per hour.
# New Listings Found
Watches in the categories: **parts**, **repair**, **for repair** have been found.
Links to the postings:
## parts
- [[WTS] Orient Ray Gen 1, Timex E-Compass (T49531), Seiko Compatible Modded Bezel Part](/r/Watchexchange/comments/gch45v/wts_orient_ray_gen_1_timex_ecompass_t49531_seiko/) (05-02-2020 20:24)
## repair
- [[WTS] Vostok, Dumai and Gameboy Watch + Clocks for Repair](/r/Watchexchange/comments/gcr69z/wts_vostok_dumai_and_gameboy_watch_clocks_for/) (05-03-2020 10:07)
## for repair
- [[WTS] Vostok, Dumai and Gameboy Watch + Clocks for Repair](/r/Watchexchange/comments/gcr69z/wts_vostok_dumai_and_gameboy_watch_clocks_for/) (05-03-2020 10:07)
- Python
- praw - Python wrapper for the Reddit API
- Reddit API
- Davis Goff - Goff-Davis
This project is licensed under the MIT License - see the LICENSE.md file for details