1
1
## 一言·古诗词 API
2
2
3
- <img src =" https://api.gushi.ci /all.svg " >
3
+ <img src =" https://v1.jinrishici.com /all.svg " >
4
4
5
5
### 简介
6
6
42
42
43
43
#### API举例
44
44
45
- * [ https://api.gushi.ci /all.json ] ( https://api.gushi.ci /all.json )
46
- * [ https://api.gushi.ci /all.svg ] ( https://api.gushi.ci /all.svg )
47
- * [ https://api.gushi.ci /shuqing/libie.png ] ( https://api.gushi.ci /shuqing/libie.png )
48
- * [ https://api.gushi.ci /rensheng.txt ] ( https://api.gushi.ci /rensheng.txt )
45
+ * [ https://v1.jinrishici.com /all.json ] ( https://v1.jinrishici.com /all.json )
46
+ * [ https://v1.jinrishici.com /all.svg ] ( https://v1.jinrishici.com /all.svg )
47
+ * [ https://v1.jinrishici.com /shuqing/libie.png ] ( https://v1.jinrishici.com /shuqing/libie.png )
48
+ * [ https://v1.jinrishici.com /rensheng.txt ] ( https://v1.jinrishici.com /rensheng.txt )
49
49
50
50
#### API地址格式(仅支持https)
51
51
52
- ` https://api.gushi.ci /{一级分类}/{二级分类(可选)}.{返回格式(可选)} `
52
+ ` https://v1.jinrishici.com /{一级分类}/{二级分类(可选)}.{返回格式(可选)} `
53
53
54
- 查看所有目前支持的分类:[ https://api.gushi.ci / ] ( https://api.gushi.ci / )
54
+ 查看所有目前支持的分类:[ https://v1.jinrishici.com / ] ( https://v1.jinrishici.com / )
55
55
56
56
目前支持的后缀:.svg .txt .png .json 不加后缀默认返回 json
57
57
58
58
#### SVG 调用
59
59
60
60
``` html
61
- <img src =" https://api.gushi.ci /all.svg" >
61
+ <img src =" https://v1.jinrishici.com /all.svg" >
62
62
```
63
63
64
64
SVG后缀是我们推荐的最优调用方案,可以在部分论坛、任何博客、小程序内无损直接调用,并且可以一定程度上控制样式。缺点是部分老旧浏览器不支持。
65
65
66
66
你可以直接修改svg控制最大长度
67
67
``` html
68
- <img src =" https://api.gushi.ci /all.svg" style =" max-width :100% ;" >
68
+ <img src =" https://v1.jinrishici.com /all.svg" style =" max-width :100% ;" >
69
69
```
70
70
71
71
或者使用我们的<b >svg专用</b >的自定义参数
@@ -78,15 +78,15 @@ SVG后缀是我们推荐的最优调用方案,可以在部分论坛、任何
78
78
79
79
调用示例
80
80
``` html
81
- <img src =" https://api.gushi.ci /all.svg?font-size=18&spacing=4" >
81
+ <img src =" https://v1.jinrishici.com /all.svg?font-size=18&spacing=4" >
82
82
```
83
83
84
84
#### JSON 调用
85
85
86
86
``` html
87
87
<script >
88
88
var xhr = new XMLHttpRequest ();
89
- xhr .open (' get' , ' https://api.gushi.ci /all.json' );
89
+ xhr .open (' get' , ' https://v1.jinrishici.com /all.json' );
90
90
xhr .onreadystatechange = function () {
91
91
if (xhr .readyState === 4 ) {
92
92
var data = JSON .parse (xhr .responseText );
@@ -103,7 +103,7 @@ JSON调用可以获取来源、作者、分类等信息,可以供你自定义
103
103
#### PNG 调用
104
104
105
105
``` html
106
- <img src =" https://api.gushi.ci /all.png" >
106
+ <img src =" https://v1.jinrishici.com /all.png" >
107
107
```
108
108
109
109
我们会提供透明的PNG文件。PNG方法兼容性最好,可以在几乎任何地方插入。并且支持所有浏览器。缺点是不能控制样式,另外,由于流量限制,我们只会给您传送较小的图片源文件。
@@ -113,7 +113,7 @@ JSON调用可以获取来源、作者、分类等信息,可以供你自定义
113
113
``` html
114
114
<script >
115
115
var xhr = new XMLHttpRequest ();
116
- xhr .open (' get' , ' https://api.gushi.ci /all.txt' );
116
+ xhr .open (' get' , ' https://v1.jinrishici.com /all.txt' );
117
117
xhr .onreadystatechange = function () {
118
118
if (xhr .readyState === 4 ) {
119
119
var gushici = document .getElementById (' gushici' );
@@ -127,7 +127,7 @@ JSON调用可以获取来源、作者、分类等信息,可以供你自定义
127
127
TXT调用和JSON调用基本一致,可以节省一些流量。或者,你甚至可以使用 iframe 来调用我们的接口
128
128
129
129
#### 获取七天点击量数据
130
- [ https://api.gushi.ci /log ] ( https://api.gushi.ci /log )
130
+ [ https://v1.jinrishici.com /log ] ( https://v1.jinrishici.com /log )
131
131
132
132
133
133
### 技术说明
0 commit comments