From 71b65753cfed7c919e6a5ca7339975da251acc5b Mon Sep 17 00:00:00 2001 From: Richard Mwewa <74001397+rly0nheart@users.noreply.github.com> Date: Sun, 6 Aug 2023 05:35:46 +0200 Subject: [PATCH] Update __main.py Added json file logger for found posts. --- rpst/__main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rpst/__main.py b/rpst/__main.py index 4b28fb6..44c7540 100644 --- a/rpst/__main.py +++ b/rpst/__main.py @@ -1,16 +1,16 @@ from datetime import datetime -from rpst.__rpst import log, start_scraper, check_updates, create_parser +from rpst.__rpst import log, get_posts, check_updates, create_parser def run(): """ Main entry point for the program. It creates a parser, parses the command line arguments, - checks for updates, starts the scraper, and handles any exceptions that occur during the execution. + checks for updates, gets posts, and handles any exceptions that occur during the execution. """ # Create a parser and parse the command line arguments parser = create_parser() - args = parser.parse_args() + arguments = parser.parse_args() # Record the start time start_time = datetime.now() @@ -19,9 +19,8 @@ def run(): # Check for updates check_updates(version_tag="1.4.0.0") - # Start the scraper with the parsed arguments - start_scraper(keyword=args.keyword, subreddit=args.subreddit, - listing=args.listing, timeframe=args.timeframe, limit=args.limit) + # Get posts with the provided/parsed arguments + get_posts(arguments=arguments) except KeyboardInterrupt: log.warning("User interruption detected.") except Exception as e: