master
iotcat 4 years ago
parent 1a682762a4
commit 3136f517d6
  1. 137
      source/_posts/memobird-printer-api.md
  2. 192
      source/_posts/music-api.md
  3. 96
      source/_posts/words-api.md

@ -0,0 +1,137 @@
---
title: 咕咕机API
titleEN: Memobird Printer API
date: 2019-04-23
categories:
- tech
tags:
- api
- motto
---
{% raw %}<span class=".zh">{% endraw %}
这是一个简易的咕咕机API哦~
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
This is a simple Memobird Printer API~
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
page.tran.setLang('zh');
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
}, true]]
});
}
});
</script>
{% endraw %}
{% raw %}<span class=".zh">{% endraw %}
> 本API仅为官方接口的二次封装,意在降低其使用门槛。本站承诺不会保存任何使用者信息。如果您对本站存有疑惑,请慎重使用本接口!!本接口[源码](https://github.yimian.xyz/iotcat/gugu-api)
## 参数
- `ak`: 咕咕机AccessKey(前往[咕咕机开放平台](https://open.memobird.cn/)申请)
- `userID`: 用户的咕咕号(手机软件>>我的>>头像旁边的咕咕号)
- `memobirdID`: 咕咕机ID(手机软件>>我的>>我的咕咕机>>咕咕机>>设备编号)
- `body`: 内容
## 请求地址
````
GET https://api.yimian.xyz/gugu/
````
## 示例
````
https://api.yimian.xyz/gugu/?ak=9e55121803474371bfa25d20e554b31d&userID=832598&memobirdID=c3ee06a8bd9b49e1&body=你好呀世界
````
## 返回值(plaintext)
- 成功:
```js
{
"showapi_res_code": 1, //1为发送成功,0为失败
"showapi_res_error": "ok", //"ok"为发送成功,否则显示错误信息
"result": 1, //1为打印成功
"smartGuid": "149e2257412e532e", //会话标识符
"printcontentid": 234784 //打印内容识别编码
}
```
- 失败:
```js
{
"showapi_res_code": 1, //1为发送成功,0为失败
"showapi_res_error": "错误信息" //否则显示错误信息
}
```
> 更多用法见[官方文件](http://open.memobird.cn/upload/webapi.pdf)
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
> This API is only a simplified package of the official interface, intending to lower the threshold for its use. This site promises not to save any user information. If you have any doubts about this site, please use this interface carefully! ! This interface [source code](https://github.yimian.xyz/iotcat/gugu-api).
## Parameters
-`ak`: Memobird Printer AccessKey (Go to [Memobird Printer Open Platform](https://open.memobird.cn/) to apply)
-`userID`: the user's id (the User id is next to the avatar in mobile Memobird software)
-`memobirdID`: Memobird Printer ID (Find it in the mobile Memobird software)
-`body`: content to print
## Request address
````
GET https://api.yimian.xyz/gugu/
````
## Example
````
https://api.yimian.xyz/gugu/?ak=9e55121803474371bfa25d20e554b31d&userID=832598&memobirdID=c3ee06a8bd9b49e1&body=Hello world
````
## Return value (plaintext)
- Success:
```js
{
"showapi_res_code": 1, //1 means transmission is successful, 0 means failure
"showapi_res_error": "ok", //"ok" means the transmission is successful, otherwise an error message will be displayed
"result": 1, //1 means successful printing
"smartGuid": "149e2257412e532e", //session identifier
"printcontentid": 234784 //Print content identification code
}
```
- Failure:
```js
{
"showapi_res_code": 1, //1 means sending successfully, 0 means failure
"showapi_res_error": "Error message" //Otherwise display error message
}
```
> For more usage, please refer to [Official Document](http://open.memobird.cn/upload/webapi.pdf)
{% raw %}</span>{% endraw %}

@ -0,0 +1,192 @@
---
title: 网易云音乐获取API
titleEN: Netease Music API
date: 2019-07-29
categories:
- tech
tags:
- api
- music
---
{% raw %}<span class=".zh">{% endraw %}
封装好的网易云音乐API,欢迎大家调用━(*`∀´*)ノ亻!
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
The packaged NetEase Cloud Music API, welcome everyone to use ━(*`∀´*)ノ亻!
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
page.tran.setLang('zh');
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
}, true]]
});
}
});
</script>
{% endraw %}
{% raw %}<span class=".zh">{% endraw %}
## 参数
- `type`: (必填)模式类型 `type`=`single`单曲信息/`playlist`歌单歌曲信息/`url`获取歌曲/`cover`获取封面/`lrc`获取歌词
- `id`: (必填,搭配type使用)歌单或歌曲id e.g. `id`=`198401123`
- `random`: 仅对playlist有效,返回的歌曲是否打乱顺序,默认`false`. e.g. `random`=`true`
- `limit`: 返回歌单最大长度 e.g. `limit`=`10`
> 歌单和歌曲的id可以从[云音乐网页版](https://music.163.com/#/my/)获取。点开歌单或歌曲,查看浏览器地址栏,如下图:
> ![Playlist Id](https://api.yimian.xyz/img/?path=imgbed/img_dfeddac_552x34_8_null_normal.jpeg)
> ![Single Song Id](https://api.yimian.xyz/img/?path=imgbed/img_527a5ea_491x37_8_null_normal.jpeg)
## 请求地址
````
GET https://api.yimian.xyz/msc/
````
## 示例
````
//获取id为36308263的歌曲信息
https://api.yimian.xyz/msc/?type=single&id=36308263
//获取id为808097971的歌单所有歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=808097971
//获取808097971歌单前14首歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14
//随机从808097971歌单获取14首歌曲信息
https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14&random=true
//获取36308263的mp3音乐文件
https://api.yimian.xyz/msc/?type=url&id=36308263
//获取id为3384296792803059的封面图片
https://api.yimian.xyz/msc/?type=cover&id=3384296792803059
//获取36308263歌曲的lrc歌词文件
https://api.yimian.xyz/msc/?type=lrc&id=36308263
````
## 返回值(json格式)
- single单曲模式:
```js
{
id: "歌曲id",
name: "歌曲名称",
artist: "第一作者",
album: "专辑名称",
url: "单曲地址",
cover: "封面地址",
lrc: "歌词地址"
}
```
- playlist歌单模式:
```js
[
{
id: "歌曲id",
name: "歌曲名称",
artist: "第一作者",
album: "专辑名称",
url: "单曲地址",
cover: "封面地址",
lrc: "歌词地址"
},
{歌曲2..},
{歌曲3..}
]
```
- 错误:
```js
{code: 500, err: "错误信息"}
```
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
## Parameters
- `type`: (Required) Mode type `type`=`single` single information/`playlist` song information/`url` get song/`cover` get cover/`lrc` get lyrics
- `id`: (Required, used with type) Playlist or song id e.g. `id`=`198401123`
- `random`: Only valid for playlist, whether the returned songs are out of order, the default is `false`. e.g. `random`=`true`
- `limit`: return the maximum length of the playlist e.g. `limit`=`10`
> Playlist and song id can be obtained from [Cloud Music Web Version](https://music.163.com/#/my/). Click to open a playlist or song, and check the browser address bar, as shown below:
> ![Playlist Id](https://api.yimian.xyz/img/?path=imgbed/img_dfeddac_552x34_8_null_normal.jpeg)
> ![Single Song Id](https://api.yimian.xyz/img/?path=imgbed/img_527a5ea_491x37_8_null_normal.jpeg)
## Request address
````
GET https://api.yimian.xyz/msc/
````
## Example
````
//Get song information with id 36308263
https://api.yimian.xyz/msc/?type=single&id=36308263
//Get all song information of the playlist with id 808097971
https://api.yimian.xyz/msc/?type=playlist&id=808097971
//Get information about the first 14 songs of the 808097971 playlist
https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14
//Get 14 song information randomly from 808097971 playlist
https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14&random=true
//Get 36308263 mp3 music file
https://api.yimian.xyz/msc/?type=url&id=36308263
//Get the cover image with id 3384296792803059
https://api.yimian.xyz/msc/?type=cover&id=3384296792803059
//Get the lrc lyrics file of 36308263 song
https://api.yimian.xyz/msc/?type=lrc&id=36308263
````
## Return value (json format)
- single mode:
```js
{
id: "Song id",
name: "Song name",
artist: "First Author",
album: "Album Name",
url: "Single address",
cover: "Cover Address",
lrc: "Lyrics address"
}
```
- Playlist playlist mode:
```js
[
{
id: "Song id",
name: "Song name",
artist: "First Author",
album: "Album Name",
url: "Single address",
cover: "Cover Address",
lrc: "Lyrics address"
},
{Song 2..},
{Song 3..}
]
```
- Error:
```js
{code: 500, err: "error message"}
```
{% raw %}</span>{% endraw %}

@ -0,0 +1,96 @@
---
title: 呓喵酱的一言API
titleEN: IoTcat's Motto API
date: 2019-07-30
categories:
- tech
tags:
- api
- motto
---
{% raw %}<span class=".zh">{% endraw %}
这里是呓喵酱的语录API哦~
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
Hi~ This is the API of IoTcat's Motto..
{% raw %}</span>{% endraw %}
<!--more-->
{% raw %}
<script>
session.onload(function(){
if(page.tran.getLang() == 'en'){
tips.warning({
title: 'Caution',
position: 'topRight',
message: 'This page was translated by Machine!!',
buttons: [['<button>Show Original Page</button>', function (instance, toast) {
page.tran.setLang('zh');
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
}, true]]
});
}
});
</script>
{% endraw %}
{% raw %}<span class=".zh">{% endraw %}
## 参数
- `lang`: (可选)语言 e.g. `lang`=`en`(英语)/`zh`(中文)
## 请求地址
````
GET https://api.yimian.xyz/words/
````
## 示例
````
//随机获取一句中文语录
https://api.yimian.xyz/words/
//随机获取一句英文语录
https://api.yimian.xyz/words/?lang=en
````
## 返回值(plaintext)
```
随机一句话
```
{% raw %}</span>{% endraw %}
{% raw %}<span class=".en">{% endraw %}
## Parameters
- `lang`: (optional) Language setting. e.g. `lang`=`en`(English)/`zh`(Chinese)
## Request address
````
GET https://api.yimian.xyz/words/
````
## Example
````
//Get a random Chinese quotation
https://api.yimian.xyz/words/
//Get a random English quotation
https://api.yimian.xyz/words/?lang=en
````
## Return value (plaintext)
```
Random sentence..
```
{% raw %}</span>{% endraw %}
Loading…
Cancel
Save