最近在别人的安利下试了一下 Koa 框架,然后用它弄了一个 API ...
效果是这样的:
[dorajdj@yudachi-bomber ProjectAko]$ curl http://localhost:8388/api/v0/video/5176515
{"code":0,"data":{"vid":5176515,"cover":"http://i2.hdslb.com/bfs/archive/3103b63e59eb757dcf802215ed174850174192c2.jpg","title":" [ 7 月] LoveLive!Sunshine!! 01","date":1467468000000,"desc":"#01 想要闪闪发亮","uid":null,"cid":8412897,"click":452038,"danmaku":124318,"coin":5618,"favourite":1684,"duration":"47:50","reply":23069,"tags":[]}}
{
"code":0,
"data":{
"vid":5176515,
"cover":"http://i2.hdslb.com/bfs/archive/3103b63e59eb757dcf802215ed174850174192c2.jpg",
"title":" [ 7 月] LoveLive!Sunshine!! 01",
"date":1467468000000,
"desc":"#01 想要闪闪发亮",
"uid":null,
"cid":8412897,
"click":452038,
"danmaku":124318,
"coin":5618,
"favourite":1684,
"duration":"47:50",
"reply":23069,
"tags":[]
}
}
它可以抓取 Bilibili 的视频、用户和新番信息,然后弄成 JSON 方便弄 AJAX 。
关于它的详细说明可以看看这里: https://proj.yudachi.biz/ako.html
另外还有 GitHub : https://github.com/DoraJDJ/project-ako/
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.