From 60b0316f6b3eb7ee8a282728294a7b3ab68d7f20 Mon Sep 17 00:00:00 2001 From: Ryan McNamara Date: Tue, 28 Nov 2023 17:03:06 -0500 Subject: [PATCH] Feature: Add China Telegram Card - Added China Telegram to social_stats.py and fetch_social_stats.py --- logic/scripts/fetch_social_stats.py | 9 +++++++++ logic/views/social_stats.py | 1 + 2 files changed, 10 insertions(+) diff --git a/logic/scripts/fetch_social_stats.py b/logic/scripts/fetch_social_stats.py index 2c156e080b..44c5948fa7 100644 --- a/logic/scripts/fetch_social_stats.py +++ b/logic/scripts/fetch_social_stats.py @@ -136,6 +136,15 @@ def get_discord_members(): "json": False, } ) +sites.append( + { + "name": "Telegram (China)", + "url": "https://t.me/OriginChinese", + "selector": "div.tgme_page_extra", + "pattern": "([\d\s]+)\s*members", + "json": False, + } +) sites.append( { "name": "Telegram (Announcements)", diff --git a/logic/views/social_stats.py b/logic/views/social_stats.py index 675be5941b..6511c80ff8 100644 --- a/logic/views/social_stats.py +++ b/logic/views/social_stats.py @@ -25,6 +25,7 @@ def filter_social_stats(stat): "Telegram (Russia)", "Telegram (Spanish)", "Telegram (Turkish)", + "Telegram (China)", "Medium", ] if stat["name"] in general_stats: