Skip to content

Commit

Permalink
Merge pull request #560 from lbarthon/lbarthon/ecosia
Browse files Browse the repository at this point in the history
Add Ecosia support & fix Phantom regex
  • Loading branch information
elsigh authored Feb 21, 2024
2 parents d668d6c + d7d11c8 commit c318c48
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ user_agent_parsers:
family_replacement: 'Twitter'

# Phantom app
- regex: 'Mozilla.{1,200}Mobile.{1,100}(Phantom\/ios|android).(\d+)\.(\d+)\.(\d+)'
- regex: 'Mozilla.{1,200}Mobile.{1,100}(Phantom\/ios|Phantom\/android).(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Phantom'

# aspiegel.com spider (owned by Huawei, later called PetalBot)
Expand Down Expand Up @@ -457,6 +457,12 @@ user_agent_parsers:
- regex: '(Tenta/)(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Tenta Browser'

# Ecosia on iOS / Android
- regex: '(Ecosia) ios@(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Ecosia iOS'
- regex: '(Ecosia) android@(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Ecosia Android'

# Chrome Mobile
- regex: 'Version/.{1,300}(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+)'
family_replacement: 'Chrome Mobile WebView'
Expand Down
12 changes: 12 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8681,3 +8681,15 @@ test_cases:
major: '3'
minor: '2'
patch: '1'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Safari/605.1.15 (Ecosia [email protected])'
family: 'Ecosia iOS'
major: '8'
minor: '1'
patch: '3'

- user_agent_string: 'Mozilla/5.0 (Linux; Android 9; Redmi 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36 (Ecosia [email protected])'
family: 'Ecosia Android'
major: '101'
minor: '0'
patch: '4951'

0 comments on commit c318c48

Please sign in to comment.