Comments (10)
你做这种 badge 的话可以不用拿 Cloudflare 转啊,直接告诉 Shields.io 请求 IP 的 API 不就好了嘛!
对的,我就练下手,没有写过前端,无聊玩玩
from substats.
有理由吗?
from substats.
@bboysoulcn 我来解释一下吧,这个 totalSubs
是初始化一个请求里总订阅人数(总粉丝数)的,所以下面你可以看到 fetchStatsRes.totalSubs += res.value.subs
,这个接口返回的都是数字,所以 totalSubs
初始化为 0。
from substats.
@bboysoulcn 我来解释一下吧,这个
totalSubs
是初始化一个请求里总订阅人数(总粉丝数)的,所以下面你可以看到fetchStatsRes.totalSubs += res.value.subs
,这个接口返回的都是数字,所以totalSubs
初始化为 0。
嗯嗯,只是我觉得字符型通用性比较好,如果返回值是一个字符串会变成。 0字符串。这样子
from substats.
@bboysoulcn 我来解释一下吧,这个
totalSubs
是初始化一个请求里总订阅人数(总粉丝数)的,所以下面你可以看到fetchStatsRes.totalSubs += res.value.subs
,这个接口返回的都是数字,所以totalSubs
初始化为 0。嗯嗯,只是我觉得字符型通用性比较好,如果返回值是一个字符串会变成。 0字符串。这样子
@bboysoulcn 懂了,你说的这个字符串拼接的问题会在各个 handler 里处理,不会让它返回成字符串的。(至少我还没发现返回成别的的情况)
from substats.
@bboysoulcn 懂了,你说的这个字符串拼接的问题会在各个 handler 里处理,不会让它返回成字符串的。(至少我还没发现返回成别的的情况)
嗯嗯
from substats.
@bboysoulcn 我来解释一下吧,这个
totalSubs
是初始化一个请求里总订阅人数(总粉丝数)的,所以下面你可以看到fetchStatsRes.totalSubs += res.value.subs
,这个接口返回的都是数字,所以totalSubs
初始化为 0。嗯嗯,只是我觉得字符型通用性比较好,如果返回值是一个字符串会变成。 0字符串。这样子
@bboysoulcn 懂了,你说的这个字符串拼接的问题会在各个 handler 里处理,不会让它返回成字符串的。(至少我还没发现返回成别的的情况)
我写了一个返回用户ip的,但是因为是cloudflare去请求的接口,所以不能找到实际的ip,所以就发现了这个问题
from substats.
http://sb.bboysoul.cn/substats/?source=ip&queryKey=ip
from substats.
你做这种 badge 的话可以不用拿 Cloudflare 转啊,直接告诉 Shields.io 请求 IP 的 API 不就好了嘛!
from substats.
@bboysoulcn 添加了对 API 字符串数据返回的支持,详见 afdian.js
里面 afdianIncome
的实现,以及 index.js
里面特殊 API 的声明。
from substats.
Related Issues (20)
- 没有缓存模块? HOT 4
- Add support for WeChat official account HOT 1
- Add support for yuque
- The Inoreader API is not working
- Cloudflare Workaround Worker tutorial needed. HOT 7
- Instagram API strikes
- 请求添加缩写 HOT 1
- Add support for Douyin 抖音 HOT 1
- Getting multiple query params HOT 1
- Inoreader not working
- Instagram doesn't work
- Telegram not working
- CoolApk 无法识别粉丝数量 HOT 2
- Update plans for v3 HOT 1
- twitter status is down HOT 1
- Add support for Gitlab
- api.swo.moe 下的 feedly 接口无法使用
- 爱发电的接口好像有问题了 HOT 1
- Zhihu API broken - 知乎API坏掉了 HOT 2
- B站接口好像突然跪了 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from substats.