-
Notifications
You must be signed in to change notification settings - Fork 0
/
mm_watch.example.cfg
23 lines (23 loc) · 1.67 KB
/
mm_watch.example.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# User agent you wish to use. Don't lie here, reddit will ban you to death.
user_agent = '<application name>/<version> by <user>'
# The client ID given to you by reddit when you created an application. You did create one, didn't you?
client_id = '<your reddit client ID>'
# The secret for said application.
client_secret = '<your reddit client secret>'
# Your reddit username. You might want to use a different account from your primary one for this.
username = '<your reddit username>'
# Your reddit password.
password = '<your reddit password>'
# Your Pushbullet access token that you got from them. I use Pushbullet because I'm lame.
pushbullet_access_token = 'A pushbullet access token'
# The subreddit you wish to watch. This will probably always stay as mechmarket
subreddit = 'mechmarket'
# Regex to search the title for. This requires some more explanation:
# Your regex needs to have three named groups: location, selling, and asking.
# location should capture the location specified in the title, contained within the brackets
# selling should capture everything after the [H], and this is where you'll include anything specific you want.
# In the example below, I'm searching for an Ergodox keyboard
# Finally, you want to capture what they're askig for, so everything after the [W]. What's in the example here should suffice.
title_regex = '^(?P<location>\[[^\]]+\])[^\[]*\[[Hh]\](?P<selling>[^\[]*[Ee]rgo[Dd]ox[^\[]*)\[[Ww]\](?P<asking>.*$)'
# This tries to find the price in the body of the text. You probably want to just leave this as is.
price_regex_pattern = '^.*{}.*?((?P<prefix_unit>[$£€])?\s?(?P<price>[0-9]+([,.][0-9])*)\s*(?(prefix_unit)|(?P<postfix_unit>usd|gbp|eur|€))?)[^$£€]*$'