From b5a9a5fbdd3701f6397d472d8dcf72e6a328da5a Mon Sep 17 00:00:00 2001 From: Eliot Berriot <contact@eliotberriot.com> Date: Mon, 1 Jul 2019 18:45:52 +0200 Subject: [PATCH] Added itch.io as a contribution platform --- retribute_api/providers.py | 10 ++++++++++ tests/search/test_means.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/retribute_api/providers.py b/retribute_api/providers.py index 0df4df9..f8bc786 100644 --- a/retribute_api/providers.py +++ b/retribute_api/providers.py @@ -150,6 +150,16 @@ class BandCamp(BasicUsernameInDomainProvider): username_regex = r"^(\w+)\.bandcamp\.com" +@registry.register +class ItchIo(BasicUsernameInDomainProvider): + id = "itch-io" + additional_ids = ["itch", "itch.io"] + label = "itch.io" + url = "https://itch.io" + + username_regex = r"^(\w+)\.itch\.io" + + @registry.register class Custom(Provider): id = "custom" diff --git a/tests/search/test_means.py b/tests/search/test_means.py index e9537c6..cfab2ca 100644 --- a/tests/search/test_means.py +++ b/tests/search/test_means.py @@ -41,6 +41,11 @@ from retribute_api.search import means "https://flattr.com/profile/username", {"provider": "flattr", "id": "username"}, ), + ( + "https://flattr.com/profile/username", + {"provider": "flattr", "id": "username"}, + ), + ("https://username.itch.io", {"provider": "itch-io", "id": "username"}), ], ) def test_extract_from_url(input, expected): -- GitLab