def bot():
    for sub in approved_subs:
        log("Checking for posts in /r/" + sub, Color.BLUE)
        now = datetime.datetime.utcnow()
        now_minus_10 = now + datetime.timedelta(minutes=-10)
        float_now_minus_10 = time.mktime(now_minus_10.timetuple())
        subreddit = r.get_subreddit(sub)
        submissions = [p for p in subreddit.get_new(limit=200) if p.created_utc > float_now_minus_10]
        for submission in sorted(submissions, key=lambda p: p.created_utc):
            is_valid, has_commented = submission_is_valid(submission)
            log("Analyzing " + submission.title)
            if is_valid:
                log("New Post in /r/" + submission.subreddit.display_name + " - " + submission.url, Color.GREEN)
                process_submission(submission)
                if dry_run:
                    sys.exit("Done")
            elif has_commented:
                return
            else:
                continue

        if len(submissions) == 0:
            log("Nothing new", Color.BLUE)


# Main method
dataset/ETHPy150Open hzsweers/gfy_mirror/gfy_mirror/bot.py/bot/original