1
0

Medium blogging platform support
All checks were successful
Python Package / Package (push) Has been skipped

This commit is contained in:
Jon Michael Aanes 2024-02-17 21:18:53 +01:00
parent a37027dd8a
commit 9f6068b2f5
2 changed files with 29 additions and 0 deletions

View File

@ -37,6 +37,7 @@ class SocialSiteId(aenum.Enum):
EMAIL = 16
JSON_LD = 17 # Similar to PAGE_WATCH, but focused on embedded microdata
SUBSTACK = 18
MEDIUM_BLOG = 3899
ETSY_SHOP = 19
KO_FI = 20
BEHANCE_PAGE = 21
@ -146,6 +147,21 @@ WIKIDATA_PROPERTIES = {
SocialSiteId.STEAM_APPLICATION_ID: WikidataInfo(1733, None),
SocialSiteId.GITHUB_REPOSITORY: WikidataInfo(None, 364),
SocialSiteId.LINKEDIN_PERSONAL_PROFILE: WikidataInfo(6634, None),
SocialSiteId.MEDIUM_BLOG : WikidataInfo(3899, None),
SocialSiteId.SUBSTACK : WikidataInfo(12007, None),
SocialSiteId.INPRNT_PAGE: WikidataInfo(None, None),
SocialSiteId.ETSY_SHOP: WikidataInfo(None, 1353939),
SocialSiteId.KO_FI: WikidataInfo(None, 77949925),
SocialSiteId.BEHANCE_PAGE: WikidataInfo(None, 4880667),
SocialSiteId.PLURK: WikidataInfo(None, 32111),
# Weird internal
SocialSiteId.LINK_COLLECTION_PAGE: WikidataInfo(None, None),
SocialSiteId.PAGE_WATCH: WikidataInfo(None, None),
SocialSiteId.JSON_LD: WikidataInfo(None, None),
SocialSiteId.FIREFOX_PROFILE_BOOKMARKS: WikidataInfo(None, None),
SocialSiteId.FALKON_PROFILE_BOOKMARKS: WikidataInfo(None, None),
}
def re_social_subdomain(main_domain):
@ -270,6 +286,10 @@ REGEXES = [
# Substack
(SUBSTACK_PREFIX_URL, SocialSiteId.SUBSTACK),
# Medium
(re_social_path_adv('medium.com', RE_ID), SocialSiteId.MEDIUM_BLOG),
(re_social_subdomain('medium.com'), SocialSiteId.MEDIUM_BLOG),
# Etsy shop
(ETSY_SHOP_URL, SocialSiteId.ETSY_SHOP),

9
test/test_consistency.py Normal file
View File

@ -0,0 +1,9 @@
import socials_util
import pytest
@pytest.mark.parametrize('social_site_id', list(socials_util.SocialSiteId))
def test_consistency(social_site_id):
assert social_site_id in socials_util.WIKIDATA_PROPERTIES