def scrape(): """ Sets up the scraper to scrape HN and Reddit. """ app.logger.info("Scraping Reddit") scrape_reddit = Scraper(app.logger) scrape_reddit.gather_reddit_data() app.logger.info("Finished gathering data, inserting into DB") scrape_reddit.insert_into_db() app.logger.info("Finished inserting into DB, sleeping for %d minutes..." % (SCRAPING_INTERVAL / 60.0)) threading.Timer(SCRAPING_INTERVAL, scrape).start()