最近在别人的安利下试了一下 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/
1
majinjing3 2016-07-03 14:25:03 +08:00 via Android
做 UI 的,都感觉好高端的样子~
|
2
dixyes 2016-07-03 15:07:44 +08:00 via Android
看成 aho hhhh
|
3
dphdjy 2016-07-03 19:52:26 +08:00 via Android
检测 accept ,无参用 clitable 多好 XD
|
4
cyr1l 2016-07-04 00:06:12 +08:00
公交车是什么梗?
|
5
DoraJDJ OP @cyr1l 我在上学时,经常坐 203 跟 322 这两路公交车,然后...
莫名对公交车感兴趣了 :P 然后无聊弄了这么个小彩蛋(应该是?) |
8
xhowhy 2016-07-04 09:41:14 +08:00 1
的却毫无意义
|
9
DoraJDJ OP @xhowhy 估计是我太专制于某些地方了,所以才做不出有意义的东西。
我现在很后悔我为何要在我脑洞大开的时候去写垃圾文而不是弄些好玩的东西来。 |
11
for8ever 2016-07-05 09:02:00 +08:00
我也用 koa 写了个 https://github.com/hojas/kblog
|