From f4e2b55113a50199e5f01f657a4e2ddb703b1648 Mon Sep 17 00:00:00 2001 From: Hoggins! Date: Wed, 6 Aug 2025 16:34:38 +0200 Subject: [PATCH] Add Mastodon Bot UA --- regexes.yaml | 4 ++++ tests/test_ua.yaml | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/regexes.yaml b/regexes.yaml index 7b12c52b..e0e6b34c 100644 --- a/regexes.yaml +++ b/regexes.yaml @@ -128,6 +128,10 @@ user_agent_parsers: - regex: '(Twitterbot)/(\d+)\.(\d+)' family_replacement: 'Twitterbot' + # Mastodon + - regex: '(Mastodon)\/(\d+)\.(\d+)\.(\d+(-\S*)?)' + family_replacement: 'Mastodon' + # Bots Pattern 'name/0.0.0' - regex: '/((?:Ant-|)Nutch|[A-z]+[Bb]ot|[A-z]+[Ss]pider|Axtaris|fetchurl|Isara|ShopSalad|Tailsweep)[ \-](\d+)(?:\.(\d+)|)(?:\.(\d+)|)' # Bots Pattern 'name/0.0.0' diff --git a/tests/test_ua.yaml b/tests/test_ua.yaml index 07dae4a8..a22a28df 100644 --- a/tests/test_ua.yaml +++ b/tests/test_ua.yaml @@ -470,6 +470,18 @@ test_cases: minor: '0' patch: + - user_agent_string: 'Mastodon/4.4.3 (http.rb/5.3.1; +https://mastodon.world/) Bot' + family: 'Mastodon' + major: '4' + minor: '4' + patch: '3' + + - user_agent_string: 'Mastodon/4.5.0-alpha.1 (http.rb/5.3.1; +https://aus.social/)' + family: 'Mastodon' + major: '4' + minor: '5' + patch: '0-apha.1' + - user_agent_string: 'WhatsApp/2.17.70 W' family: 'WhatsApp' major: '2'