From 55177456e5b3134116c783821f2af447ed04dcda Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 Jul 2022 16:56:06 +0100 Subject: [PATCH 1/3] Emojis representing twitter link --- filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filters.py b/filters.py index d471481ce..bce3cf468 100644 --- a/filters.py +++ b/filters.py @@ -106,7 +106,7 @@ def _is_twitter_post(content: str) -> bool: """ features = ( '/twitter.', '/nitter.', '@twitter.', '@nitter.', - '>RT <', '_tw<', '_tw@', 'tweet', 'Tweet' + '>RT <', '_tw<', '_tw@', 'tweet', 'Tweet', '🐦🔗' ) for feat in features: if feat in content: From 1efcea73e024b522263909068c4e99deb6ac9bf5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 Jul 2022 17:05:28 +0100 Subject: [PATCH 2/3] Add a space to the emoji count estimate, to avoid too many false positives --- inbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inbox.py b/inbox.py index 998ee2870..584da08f1 100644 --- a/inbox.py +++ b/inbox.py @@ -2584,7 +2584,7 @@ def _estimate_number_of_mentions(content: str) -> int: def _estimate_number_of_emoji(content: str) -> int: """Returns a rough estimate of the number of emoji """ - return int(content.count(':') / 2) + return content.count(' :') def _valid_post_content(base_dir: str, nickname: str, domain: str, From 2ec98dfefc9501e61a18793377c3d369f991672c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 Jul 2022 17:17:09 +0100 Subject: [PATCH 3/3] Improve mentions count estimate --- inbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inbox.py b/inbox.py index 584da08f1..b4ba1c3a0 100644 --- a/inbox.py +++ b/inbox.py @@ -2578,7 +2578,7 @@ def populate_replies(base_dir: str, http_prefix: str, domain: str, def _estimate_number_of_mentions(content: str) -> int: """Returns a rough estimate of the number of mentions """ - return int(content.count('@') / 2) + return content.count('>@<') def _estimate_number_of_emoji(content: str) -> int: