diff --git a/README.md b/README.md index 17b5bea..f46e614 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ -# ChannelTree - + +
+ +# TGCN 频道树 + +这是 2025 年植树节的时候在 telegram 上和大家一起种下的频道树 qwq + +活动结束的时候树上有 214 个频道,其中有 74 根树枝和 140 个树叶。树上大小频道都有,最大的频道有 83,385 订阅量哇。开坑的时完全没有想到会有这样的影响力,感谢大家参与哦~ + +可以在 https://tree.aza.moe 查看最终的完整频道树,或者从[树根](https://tree.aza.moe/c/hykilp)开始跟随树杈🔗探索频道树。 + +这个仓库里是「TGCN 植树机器人」和网页服务器的源码,以及频道树的数据备份。 + +### 颁奖(?) + +下面是一些在可能有意思的极值上的频道 qwq +(因为包含自己的树根频道有些作弊,下面是除了树根以外的频道哦) + +**最高的树叶**: [@PaffWarehouse](https://t.me/PaffWarehouse) +离树根的距离为 10 个频道 + +**树叶最多的树枝**: [@XLDFDZ](https://t.me/XLDFDZ) +有 17 个分叉(3 个树枝和 14 个树叶) + +**树枝最多的树枝**: [@Billchenla](https://t.me/Billchenla) +有 5 个分叉(全都是树枝) + +**订阅量最多**: [@pixiv_top50](https://t.me/pixiv_top50) +有 83,385 位订阅者 + +**频道@名最长**: [@TooLongloonglooongloooonglooooon](https://t.me/TooLongloonglooongloooonglooooon) +@名有 32 个字符 + +**自挂东南枝**: [@lovemachine520](https://t.me/lovemachine520) 和 [@MG08ACA16TE](https://t.me/MG08ACA16TE) +学会了用奇妙改名漏洞让自己爬上树的人类 + +**上树频道最多的管理**: [@clanstnya](https://t.me/clanstnya) +给频道树添加了 6 个频道 + +**名字听起来最好吃的频道(R1 钦定)**: [@chheese_cookie_bedrock](https://t.me/chheese_cookie_bedrock) +「奶酪基岩饼干」 + + + +~~**名字听起来最圆圆的让人想 ruarua 的频道**: [@catttballl](https://t.me/catttballl)~~ +「Rua~rua~猫猫球」🐈 + diff --git a/analysis.py b/analysis.py new file mode 100644 index 0000000..7acd41d --- /dev/null +++ b/analysis.py @@ -0,0 +1,74 @@ +import re + +from tqdm import tqdm + +import db +from bot import channel_html + + +def exp1(): + pop = [] + r = re.compile(r"([\d ]+) subscribers") + for channel in tqdm(db.Channel.select()): + html = channel_html(channel.username) + m = r.search(html) + pop.append((channel.username, int(m.group(1).replace(" ", "")) if m else 0)) + + pop.sort(key=lambda x: x[1], reverse=True) + for channel, subscribers in pop: + print(f"{channel} - {subscribers}") + + +def exp2(name): + # Count leaf and nodes in children (leaf is a channel without children) + xl = db.channel_info(name) + leaf_count = 0 + node_count = 0 + for child in xl.children: + if child.children: + node_count += 1 + else: + leaf_count += 1 + print(f"Leaf: {leaf_count}, Node: {node_count}") + + +def exp3(): + # Find the channel with the most leafs and the channel with the most non-leafs + most_leafs = None + most_non_leafs = None + most_leafs_count = 0 + most_non_leafs_count = 0 + + for channel in tqdm(db.Channel.select()): + if channel.height == 0: + continue + leaf_count = 0 + non_leaf_count = 0 + for child in channel.children: + if child.children: + non_leaf_count += 1 + else: + leaf_count += 1 + + if leaf_count > most_leafs_count: + most_leafs = channel + most_leafs_count = leaf_count + + if non_leaf_count > most_non_leafs_count: + most_non_leafs = channel + most_non_leafs_count = non_leaf_count + + print(f"Most Leafs: {most_leafs.username} - {most_leafs_count}") + print(f"Most Non Leafs: {most_non_leafs.username} - {most_non_leafs_count}") + + +if __name__ == '__main__': + # exp1() + + # exp2("XLDFDZ") + # exp2("Billchenla") + + exp3() + + + diff --git a/docs/deepseek-food-selection.png b/docs/deepseek-food-selection.png new file mode 100644 index 0000000..c0ce343 Binary files /dev/null and b/docs/deepseek-food-selection.png differ