| @@ -98,7 +98,7 @@ for p in reversed(t.entries): | |||||
| # process only unprocessed tweets less than n days old | # process only unprocessed tweets less than n days old | ||||
| if datetime.now() - posttime > timedelta(days=days): | if datetime.now() - posttime > timedelta(days=days): | ||||
| shouldpost = False | shouldpost = False | ||||
| print("skip: Post too old") | |||||
| print("skip: Tweet older than %s days" % days) | |||||
| # kill tweets with fb links with fire! | # kill tweets with fb links with fire! | ||||
| if "https://www.facebook.com" in p.title or "https://m.facebook.com" in p.title: | if "https://www.facebook.com" in p.title or "https://m.facebook.com" in p.title: | ||||
| shouldpost = False | shouldpost = False | ||||
| @@ -180,9 +180,16 @@ for p in reversed(s.entries): | |||||
| ) | ) | ||||
| last = db.fetchone() | last = db.fetchone() | ||||
| # process only unprocessed post less than n days old | |||||
| posttime = datetime(p.published_parsed.tm_year, p.published_parsed.tm_mon, p.published_parsed.tm_mday, p.published_parsed.tm_hour, p.published_parsed.tm_min, p.published_parsed.tm_sec) | |||||
| if last is None and (datetime.now() - posttime < timedelta(days=days)): | |||||
| if last is not None: | |||||
| shouldpost = False | |||||
| print("skip: already posted") | |||||
| # process only unprocessed tweets less than n days old | |||||
| if datetime.now() - posttime > timedelta(days=days): | |||||
| shouldpost = False | |||||
| print("skip: Posting older than %s days" % days) | |||||
| if shouldpost: | |||||
| # Create application if it does not exist | # Create application if it does not exist | ||||
| mastodon_api = register_app(mastuser, mastpasswd, mastinstance, mastodon_api) | mastodon_api = register_app(mastuser, mastpasswd, mastinstance, mastodon_api) | ||||