substats

substats

跨平台社交媒体订阅者统计无服务器API

substats是一个基于Cloudflare Workers的无服务器API,用于统计多个社交媒体和内容平台的关注者数量。它通过简单的HTTP请求接口支持多个数据源,并可与shields.io集成生成动态徽章。目前处于2.0版本beta阶段,该项目为开发者和内容创作者提供了一种简便方式来展示和追踪其在线影响力。

substatsAPI关注者统计服务集成徽章生成Github开源项目
<div align="center"> <img src="https://yellow-cdn.veclightyear.com/835a84d5/7bc6500f-38cb-4475-8440-57d2999f188e.png" alt="substats" /> <h3><a href="https://api.swo.moe/stats">substats</a></h3> <p><a href="#开始使用">开始使用</a> · <a href="#最新动态">最新动态</a> · <a href="#赞助">赞助</a></p> <p>( `д′) <em>我有多少粉丝?有多少!</em></p> <img src="https://img.shields.io/badge/Cloudflare-F69652?style=flat&logo=cloudflare&logoColor=white" alt="Cloudflare Workers" /> <img src="https://img.shields.io/badge/Version-2.0*-F69652?style=flat&labelColor=2B3137" alt="Version 2.0/substats" /> <a href="https://github.com/spencerwooo/substats/actions?query=workflow%3ADeploy"><img src="https://github.com/spencerwooo/substats/workflows/Deploy/badge.svg" alt="Vercel" /></a> </div>

开始使用

sub · stats /səb ˈ stats/

  • 一个用于获取您在各种服务中粉丝数量的无服务器API

*版本2.0仍处于"测试阶段",并非所有功能都从1.0版本移植过来。详情请查看下方👇

基础用法

https://api.swo.moe

您的请求:

GET /stats/:source/:key

我的响应:

{ source: string, key: string, failed: true | false, count: number | string // 当source不等于'common'时,通常是一个数字 }

没错,现在就是这么简单。;)

*注意,key需要进行URL编码,如果您请求feedlyinoreaderfeedspub路由时请记住这一点。

制作徽章 🎫

当然可以!事实上,substats与shields.io/dynamic路由配合得很好。下面这些徽章都是使用substats的数据动态生成的: GitHub Telegram 微博 少数派 爱发电 即刻 Steam 知乎 哔哩哔哩 掘金 [语雀 你可以使用我们的徽章生成器在 substats.swo.moe 轻松创建自己的徽章。

徽章生成器截图

高级用法 - /common 路由 🍀

如果你想使用的数据源尚未被支持,但它只是一个简单的 GET 请求,你可以使用以下路由:

GET /stats/common?endpoint=<url>&datapath=<path>

例如:

GET /stats/common/?endpoint=https://api.genshin.dev/domains/cecilia-garden&datapath=rewards.0.details.2.mora

在这个例子中,endpoint 是一个 API 地址:

https://api.genshin.dev/domains/cecilia-garden

这个 URL 返回的响应看起来像这样:

{ "name": "仙跳墙", "type": "锻造", // ... "rewards": [ { "details": [ { /* ... */ }, { /* ... */ }, { "mora": 1125, }, ] } ] }

因此,我们提供的 datapathrewards.0.details.2.mora。(我特意选择了这个数据,因为它包含一个数组,用来演示如何通过索引引用数组中的 mora 值。)

你提供的 endpoint 响应会使用 object-path 进行解析,构建引用响应中值的 datapath 的方法是相同的。

在这里试试我们的 /common 路由 API URL 生成器:substats.swo.moe/common

Common 路由截图

支持的数据源

  • 爱发电
  • 哔哩哔哩
  • 酷安
  • Feedly
  • FeedsPub
  • GitHub
  • Inoreader
  • Instagram
  • 即刻
  • Mastodon
  • Medium
  • 网易云音乐
  • Reddit
  • 少数派
  • Steam 游戏
  • Steam 好友
  • Telegram
  • Twitter
  • Unsplash
  • 微博
  • 中文维基百科
  • 知乎
  • 掘金
  • 语雀 <a href="https://api.swo.moe/stats/afdian/afdian"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f9d55ef9-2107-43d5-9eab-037feacbd3c2.png" width="auto" height="64px" alt="爱发电徽标" /></a> <a href="https://api.swo.moe/stats/bilibili/401742377"><img src="https://yellow-cdn.veclightyear.com/835a84d5/be2e4e9a-5808-48c8-887e-4e520f125ea7.png" width="auto" height="64px" alt="哔哩哔哩徽标" /></a> <a href="https://api.swo.moe/stats/coolapk/466253"><img src="https://yellow-cdn.veclightyear.com/835a84d5/006a1c9f-e05e-45a7-a3ce-500535b72bc8.png" width="auto" height="64px" alt="酷安徽标" /></a> <a href="https://api.swo.moe/stats/feedly/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f4d67eaa-926c-4219-bca9-afb808f9d5de.png" width="auto" height="64px" alt="Feedly徽标" /></a> <a href="https://api.swo.moe/stats/feedspub/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/e297d965-1413-42f9-b94e-40961a6fdfb2.png" width="auto" height="64px" alt="FeedsPub徽标" /></a> <a href="https://api.swo.moe/stats/github/spencerwooo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/1dd3713e-1028-4c61-82fb-3ee37da0e463.png" width="auto" height="64px" alt="GitHub徽标" /></a> <a href="https://api.swo.moe/stats/inoreader/https%3A%2F%2Fnnw.ranchero.com%2Ffeed.xml"><img src="https://yellow-cdn.veclightyear.com/835a84d5/d86bbcdc-c36c-4d33-b106-b91b9efd4369.png" width="auto" height="64px" alt="Inoreader徽标" /></a> <a href="https://api.swo.moe/stats/instagram/9gag"><img src="https://yellow-cdn.veclightyear.com/835a84d5/96cb4281-f180-4bb0-a687-4fd1bf56a77b.png" width="auto" height="64px" alt="Instagram徽标" /></a> <a href="https://api.swo.moe/stats/jike/2204A477-38C8-4D9D-9705-9C9B990BE042"><img src="https://yellow-cdn.veclightyear.com/835a84d5/84e95ad0-7ec9-4e85-a3a6-268b1b5714ff.png" width="auto" height="64px" alt="即刻徽标" /></a> <a href="https://api.swo.moe/stats/mastodon/oldpanda@mastodon.social"><img src="https://yellow-cdn.veclightyear.com/835a84d5/0ed46920-6712-40e9-8915-4cfcf6a43fdd.png" width="auto" height="64px" alt="Mastodon徽标" /></a> <a href="https://api.swo.moe/stats/medium/SpencerWooo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/4dfe9aab-7cb8-4422-9609-f09a4aed837c.png" width="auto" height="64px" alt="Medium徽标" /></a> <a href="https://api.swo.moe/stats/neteasemusic/416608258"><img src="https://yellow-cdn.veclightyear.com/835a84d5/cbe2f69b-f9ce-4b68-8bc9-9fa0875a0c22.png" width="auto" height="64px" alt="网易云音乐徽标" /></a> <a href="https://api.swo.moe/stats/reddit/jushoro"><img src="https://yellow-cdn.veclightyear.com/835a84d5/29d053a4-5a8f-4d6b-b3bd-9f7f88174eac.png" width="auto" height="64px" alt="Reddit徽标" /></a> <a href="https://api.swo.moe/stats/sspai/spencerwoo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/a9fc5a8a-a42d-48a4-bd01-57259a613804.png" width="auto" height="64px" alt="少数派徽标" /></a> <a href="https://api.swo.moe/stats/steam/401742377"><img src="https://yellow-cdn.veclightyear.com/835a84d5/48673eb4-ae62-4f82-af25-40bbf090d9c7.png" width="auto" height="64px" alt="Steam徽标" /></a> <a href="https://api.swo.moe/stats/telegram/realSpencerWoo"><img src="https://yellow-cdn.veclightyear.com/835a84d5/d9eed5a6-fd3e-4dc5-b489-1c4b5a8578b4.png" width="auto" height="64px" alt="Telegram徽标" /></a> <a href="https://api.swo.moe/stats/twitter/GenshinImpact"><img src="https://yellow-cdn.veclightyear.com/835a84d5/273734d0-ee92-470a-8c18-b9eb06bf313c.png" width="auto" height="64px" alt="Twitter徽标" /></a> <a href="https://api.swo.moe/stats/unsplash/adamhoang"><img src="https://yellow-cdn.veclightyear.com/835a84d5/35022e59-4a96-453b-9bcf-54fdac96dbfd.png" width="auto" height="64px" alt="Unsplash徽标" /></a> <a href="https://api.swo.moe/stats/weibo/5648729445"><img src="https://yellow-cdn.veclightyear.com/835a84d5/6499fe6d-76c6-4d39-9b16-e0315e28dc0d.png" width="auto" height="64px" alt="微博徽标" /></a> <a href="https://api.swo.moe/stats/wikipediazh/ChenSimon"><img src="https://yellow-cdn.veclightyear.com/835a84d5/b7c97372-eddb-4ff7-a84d-16442df932a0.png" width="auto" height="64px" alt="维基百科徽标" /></a> <a href="https://api.swo.moe/stats/zhihu/bi-xiao-tian-99"><img src="https://yellow-cdn.veclightyear.com/835a84d5/b50da002-40ad-4d15-899c-b5f359f27665.png" width="auto" height="64px" alt="知乎标志" /></a> <a href="https://api.swo.moe/stats/juejin/1838039172387262"><img src="https://yellow-cdn.veclightyear.com/835a84d5/a65984b6-ecd5-452e-8145-72fe6b8de630.png" width="auto" height="64px" alt="掘金标志" /></a> <a href="https://api.swo.moe/stats/yuque/lyndon"><img src="https://yellow-cdn.veclightyear.com/835a84d5/f86fa990-3e31-459f-9760-0a088febbb5c.png" width="auto" height="64px" alt="语雀标志" /></a>

有什么新变化?

是的,substats现在已经是v2.0-beta版本了!除了API格式外,大多数更新都在底层进行。

  • 使用TypeScript重构。
  • 更新至CloudFlare的模块式workers。
  • Worker现在使用esbuild而非webpack构建,速度更快!
  • 已废弃对Newsblur的支持~~(似乎没人使用)~~。
  • 现在支持KV存储,包括instagram在内的一些路由依赖此功能来存储cookies(仍在开发中)。
  • 2.0版本中的缓存功能已移植到模块式workers,一如既往地受到支持。
  • 新的文档和查询构建器。

如果你正在寻找2.0版本中的多源和查询功能 - 它仍在重构中,因为itty-router无法解析多个查询参数,暂时阻碍了这项功能的实现。在我们等待期间,你仍可以使用1.0版本的路由。v1.0版本的README和文档(已废弃)

贡献

这是一个由pnpm管理的monorepo。./worker目录包含Cloudflare Worker模块,而./docs是一个用于文档的React网站(由ViteChakra UI驱动)。详情请查看两个包的README.md文件。

赞助

开源工作很艰难!如果你恰好喜欢这个项目并希望我继续下去,请考虑赞助我或提供一次性捐赠!感谢所有的爱与支持!

🧸 请捐赠 - 微信/支付宝 · Patreon · 爱发电

许可证

MIT

<div align="center"> <img src="https://yellow-cdn.veclightyear.com/835a84d5/f1cf4508-1ed7-44ad-b0ec-0bc627c1180f.png" /> <em>由<a href="https://spencerwoo.com">spencer woo</a>用❤️制作</em> </div>

编辑推荐精选

Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

openai-agents-python

openai-agents-python

OpenAI Agents SDK,助力开发者便捷使用 OpenAI 相关功能。

openai-agents-python 是 OpenAI 推出的一款强大 Python SDK,它为开发者提供了与 OpenAI 模型交互的高效工具,支持工具调用、结果处理、追踪等功能,涵盖多种应用场景,如研究助手、财务研究等,能显著提升开发效率,让开发者更轻松地利用 OpenAI 的技术优势。

下拉加载更多