diff --git a/bin/ephemetoot b/bin/ephemetoot index 5a318c9..8b7ff5c 100644 --- a/bin/ephemetoot +++ b/bin/ephemetoot @@ -41,6 +41,9 @@ parser.add_argument( parser.add_argument( "--datestamp", action="store_true", help="include a datetime stamp for every action (e.g. deleting a toot)" ) +parser.add_argument( + "--hide_skipped", action="store_true", help="do not write to log when skipping saved toots" +) parser.add_argument( "--schedule", action="store", metavar="'filepath'", nargs="?", const=".", help="save and load plist file on MacOS" ) diff --git a/lib/ephemetoot.py b/lib/ephemetoot.py index b4bac87..54dba3a 100644 --- a/lib/ephemetoot.py +++ b/lib/ephemetoot.py @@ -69,39 +69,43 @@ def checkToots(config, options, retry_count=0): toot_tags.add(tag.name) try: if keep_pinned and hasattr(toot, "pinned") and toot.pinned: - if options.datestamp: - print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') + if not options.hide_skipped: + if options.datestamp: + print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') - print( - "📌 skipping pinned toot - " - + str(toot.id) - ) + print( + "📌 skipping pinned toot - " + + str(toot.id) + ) elif toot.id in toots_to_keep: - if options.datestamp: - print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') - - print( - "💾 skipping saved toot - " - + str(toot.id) - ) + if not options.hide_skipped: + if options.datestamp: + print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') + + print( + "💾 skipping saved toot - " + + str(toot.id) + ) elif toot.visibility in visibility_to_keep: - if options.datestamp: - print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') - - print( - "👀 skipping " - + toot.visibility - + " toot - " - + str(toot.id) - ) + if not options.hide_skipped: + if options.datestamp: + print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') + + print( + "👀 skipping " + + toot.visibility + + " toot - " + + str(toot.id) + ) elif len(hashtags_to_keep.intersection(toot_tags)) > 0: - if options.datestamp: - print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') - - print( - "#️⃣ skipping toot with hashtag - " - + str(toot.id) - ) + if not options.hide_skipped: + if options.datestamp: + print(str( datetime.now(timezone.utc).strftime('%a %d %b %Y %H:%M:%S %z') ), end=' : ') + + print( + "#️⃣ skipping toot with hashtag - " + + str(toot.id) + ) elif cutoff_date > toot.created_at: if hasattr(toot, "reblog") and toot.reblog: if options.datestamp: