mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-05 16:23:39 +00:00
* Add initial python migration * Add pylint * Add pre-commit * Add Dockerfile * Add expression matching * Use shelve to store previous matches * Add notifications * Calculate post age * Update README.md
41 lines
857 B
Python
41 lines
857 B
Python
import argparse
|
|
import os
|
|
|
|
from config import load_yaml_file
|
|
from rfd import get_topics, look_for_matches
|
|
from loguru import logger
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description="Process some configuration.")
|
|
|
|
parser.add_argument(
|
|
"-c", "--config", type=str, required=True, help="path to configuration file"
|
|
)
|
|
|
|
parser.add_argument(
|
|
"-s",
|
|
"--storage-path",
|
|
type=str,
|
|
required=False,
|
|
default="previous_matches",
|
|
help="path to persistent storage",
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
|
|
config_path = args.config
|
|
|
|
apprise_url = os.getenv("APPRISE_URL")
|
|
|
|
config = load_yaml_file(config_path)
|
|
|
|
topics = get_topics(forum_id=9, pages=2)
|
|
|
|
logger.debug(f"config: {config}")
|
|
|
|
look_for_matches(topics, config, args.storage_path, apprise_url)
|
|
|
|
|
|
main()
|