Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

( `д′) how many followers do i have? how many!

License

NotificationsYou must be signed in to change notification settings

spencerwooo/substats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

substats

Get started ·What's new? ·Sponsoring

( `д′)how many followers do i have? how many!

Cloudflare WorkersVersion 2.0/substatsVercel

Get started

sub · stats /səb ˈ stats/

  • a serverless api for getting the number of followers of you in your favourite services

*Version 2.0 is still inbeta, not all features are ported from 1.0. Check below for details 👇

Basic

https://api.swo.moe

You request:

GET /stats/:source/:key

I respond:

{source:string,key:string,failed:true|false,count:number|string// Most often it's a number when source !== 'common'}

Yep, it's that simple now. ;)

*Note thatkey needs to be url encoded, remember this if you are requesting thefeedly,inoreader, orfeedspub routes.

Building badges 🎫

Of course! And as a matter of fact, substats works quite well withshields.io's/dynamic route. All these badges below are dynamically generated with substat's data:

GitHubTelegram微博少数派爱发电即刻Steam知乎哔哩哔哩掘金语雀

You can easily create your own badge with our badge builder atsubstats.swo.moe.

Badge builder screenshot

Advanced - the/common route 🍀

What if the source you are trying to use is not supported yet, but it's just a simpleGET request? In this case, you can use the route:

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

Such as:

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

In this case, theendpoint is an API url:

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

The response this URL returns looks like:

{"name":"Cecilia Garden","type":"Forgery",// ..."rewards": [    {"details": [        {/* ...*/ },        {/* ...*/ },        {"mora":1125,        },      ]    }  ]}

Hence, we provide thedatapath asrewards.0.details.2.mora. (I specifically chose this data as it contains an array to demonstrate how to reference the valuemora inside the array by index.)

Response from theendpoint provided by you is parsed withobject-path, and the method for constructing a referencedatapath to your value in the response is the same.

Try our/common route API URL builder here:substats.swo.moe/common.

Common route screenshot

Supported sources

  • afdian
  • bilibili
  • coolapk
  • feedly
  • feedspub
  • github
  • inoreader
  • instagram
  • jike
  • mastodon
  • medium
  • neteasemusic
  • reddit
  • sspai
  • steamgames
  • steamfriends
  • telegram
  • twitter
  • unsplash
  • weibo
  • wikipediazh
  • zhihu
  • juejin
  • yuque

logo_afdianlogo_bilibililogo_coolapklogo_feedlylogo_feedspublogo_githublogo_inoreaderlogo_inslogo_jikelogo_mastodonlogo_mediumlogo_neteasemusiclogo_redditlogo_sspailogo_steamlogo_tglogo_twitterlogo_unsplashlogo_weibologo_wikipedialogo_zhihulogo_juejinlogo_yuque

What's new?

Yes,substats is now versionv2.0-beta! Most of the updates are under-the-hood apart from API formats.

  • Refactored in TypeScript.
  • Updated to CloudFlare's module workers.
  • Worker is built withesbuild instead ofwebpack, extra fast!
  • Support for Newsblur has been deprecated(seems nobody uses it).
  • KV storages are now supported, some routes includinginstagram depends on this for storing cookies (wip).
  • Caching is ported to module workers in 2.0 and supported as always.
  • New documentation and query builder.

If you are looking for the multiple source and query functions in 2.0 - it's still under refactor, asitty-router does not parse multiple query parameters, blocking this feature here. You can still use the 1.0 route while we wait.README and documentation for v1.0 (deprecated).

Contributing

This is a monorepo managed bypnpm. Directory./worker holds the Cloudflare Worker module, and./docs is a React site for documentation (powered byVite andChakra UI). Check the README.md for both packages for details.

Sponsoring

Open-source is hard! If you happen to like this project and want me to keep going, please consider sponsoring me or providing a single donation! Thanks for all the love and support!

🧸 Please donate - 微信/支付宝 ·Patreon ·爱发电

License

MIT

made with ❤️ byspencer woo

About

( `д′) how many followers do i have? how many!

Topics

Resources

License

Stars

Watchers

Forks

Contributors14


[8]ページ先頭

©2009-2025 Movatter.jp