Skip to content

Commit 7161791

Browse files
author
CrazyWhite
committed
update
1 parent 818cb0f commit 7161791

5 files changed

Lines changed: 40 additions & 67 deletions

File tree

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Random-Picture
22

3-
随机图片 api
3+
随机图片 api
44

55
## 实验地址:
66

77
<https://illyasviel.feedia.co/> _(无稳定性保证)_
8-
<https://random-picture.vercel.app/> _(部署到 vercel)_
8+
<https://random-picture.vercel.app/> _(部署到 vercel)_
9+
>演示中图片来自<https://www.pixiv.net/users/8236670>
910
10-
### 注意:
11+
## 注意:
1112

1213
| 路径 | 说明 |
1314
| --------------- | ------------------------------------------------------- |
@@ -16,16 +17,21 @@
1617

1718
## 部署到 Vercel
1819

19-
建议 fork 后,自行修改配置,然后在 Vercel 平台上导入自己的项目
20+
fork 后,自行修改配置,然后在 Vercel 平台上导入自己的项目
2021
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2FCrazy-White%2FRandom-Picture)
2122

23+
## 部署到虚拟主机
24+
25+
上传至虚拟主机即可
26+
2227
## 关于 Rewrite
2328

2429
伪静态是可选的。
2530
开启伪静态后,将支持以<https://example.net/:id.png>形式访问
31+
例如<https://random-picture.vercel.app/1.jpg> <https://random-picture.vercel.app/2.jpg>
2632
**:id** 即图片 id,如果非数字,则随机跳转。请求会被缓存。
2733
Apache 和 Vercel 部署都直接支持伪静态。
28-
Nginx 参照以下配置:
34+
Nginx 参照以下配置:
2935

3036
```nginx
3137
location / {
@@ -57,7 +63,7 @@ location / {
5763
<p>服务器输出json</p>
5864
<pre class="language-json">
5965
<code class="language-json">
60-
{&quot;code&quot;:&quot;200&quot;,&quot;url&quot;:&quot;https:\/\/fp1.fghrsh.net\/2019\/07\/15\/c2549aaa63db078834ead6a92fe63b61.jpg&quot;}
66+
{&quot;code&quot;:&quot;200&quot;,&quot;url&quot;:&quot;https:\/\/z3.ax1x.com\/2021\/08\/19\/fqD8A0.png&quot;}
6167
</code>
6268
</pre>
6369
</section>
@@ -66,7 +72,7 @@ location / {
6672
<p>服务器读取图片信息后输出json,如非需要图片信息不建议使用</p>
6773
<pre class="language-json">
6874
<code class="language-json">
69-
{&quot;code&quot;:&quot;200&quot;,&quot;url&quot;:&quot;https:\/\/fp1.fghrsh.net\/2019\/07\/15\/c2549aaa63db078834ead6a92fe63b61.jpg&quot;,&quot;width&quot;:&quot;1920&quot;,&quot;height&quot;:&quot;1080&quot;,&quot;mime&quot;:&quot;image\/jpeg&quot;,&quot;size&quot;:&quot;821735&quot;}
75+
{&quot;code&quot;:&quot;200&quot;,&quot;url&quot;:&quot;https:\/\/z3.ax1x.com\/2021\/08\/19\/fqD8A0.png&quot;,&quot;width&quot;:&quot;1920&quot;,&quot;height&quot;:&quot;1080&quot;,&quot;mime&quot;:&quot;image\/jpeg&quot;,&quot;size&quot;:&quot;821735&quot;}
7076
</code>
7177
</pre>
7278
</section>

index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net/" />
88
<link rel="preload" href="https://cdn.jsdelivr.net/gh/kylelogue/mustard-ui/dist/css/mustard-ui.min.css" as="style" />
99
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kylelogue/mustard-ui/dist/css/mustard-ui.min.css" />
10-
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
10+
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
1111
<script>
1212
$(document).ready(function () {
1313
$('.scroll-down, .get-started').on('click', function (e) {
@@ -38,9 +38,7 @@
3838
<h1 class="title">随机图片api</h1>
3939
<h2 class="subtitle">说明文档</h2>
4040
<p class="disclaimer"><a href="show.html">图片一览</a></p>
41-
<button class="get-started button button-primary button-large">
42-
详情
43-
</button>
41+
<button class="get-started button button-primary button-large">详情</button>
4442
<a class="scroll-down" href="#"></a>
4543
</header>
4644
<section>
@@ -107,6 +105,5 @@ <h3>
107105
<a href="https://github.com/Crazy-White/Random-Picture">Github(Source Code)</a>
108106
</p>
109107
</footer>
110-
<!--</body>-->
111108
</body>
112109
</html>

show.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net/" />
88
<link rel="preload" href="https://cdn.jsdelivr.net/gh/kylelogue/mustard-ui/dist/css/mustard-ui.min.css" as="style" />
99
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kylelogue/mustard-ui/dist/css/mustard-ui.min.css" />
10-
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
10+
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
1111
<script src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"></script>
1212
<script>
1313
$(document).ready(function () {
@@ -51,9 +51,7 @@
5151
<h1 class="title">随机图片api</h1>
5252
<h2 class="subtitle">图片一览</h2>
5353
<p class="disclaimer"><a href="index.html">查看说明文档</a></p>
54-
<button class="get-started button button-primary button-large">
55-
详情
56-
</button>
54+
<button class="get-started button button-primary button-large">详情</button>
5755
<a class="scroll-down" href="#"></a>
5856
</header>
5957
<section>
@@ -97,6 +95,5 @@ <h2 class="subtitle">图片一览</h2>
9795
observer.observe();
9896
});
9997
</script>
100-
<!--</body>-->
10198
</body>
10299
</html>

url.csv

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,7 @@
1-
https://fp1.fghrsh.net/2019/07/15/69ce6ec8084631407393ace37027c740.jpg
2-
https://fp1.fghrsh.net/2019/07/15/aceb221b57c4987ac324e10aeaf69ede.jpg
3-
https://fp1.fghrsh.net/2019/07/15/fa335a48ac37c0ff56b9c82defcbd8e4.jpg
4-
https://fp1.fghrsh.net/2019/07/15/c2549aaa63db078834ead6a92fe63b61.jpg
5-
https://fp1.fghrsh.net/2019/07/15/1053a53d5894e825d6ffa373a4e406ab.jpg
6-
https://fp1.fghrsh.net/2019/07/15/bfcef2d912b646941d808f4a6fdd5e07.jpg
7-
https://fp1.fghrsh.net/2019/07/15/88c5b5b8a6d16da0d66b074001b37370.jpg
8-
https://fp1.fghrsh.net/2019/07/15/f8e66adb467a6e610a8899e654baf338.jpg
9-
https://fp1.fghrsh.net/2019/07/15/ec830798b3abf57647100b6f0feb7a22.jpg
10-
https://fp1.fghrsh.net/2019/07/15/93ec88ca47b03a36ca11e5524b127dff.jpg
11-
https://fp1.fghrsh.net/2019/07/15/b199f25562749e8c5589d045147b25f6.jpg
12-
https://fp1.fghrsh.net/2019/07/15/39a4d331296a77d5b56dceea2a4763fe.png
13-
https://fp1.fghrsh.net/2019/07/15/38f46e6610bbbe9702b32ca90399a70c.png
14-
https://fp1.fghrsh.net/2019/07/15/aaf1c6b227493bc16d1be64ff8265cbd.jpg
15-
https://fp1.fghrsh.net/2019/07/15/0ff520e67e27d1ac81f44960288dc698.png
16-
https://fp1.fghrsh.net/2019/07/15/54179cecc656b7f9147b01a471c5d30a.jpg
17-
https://fp1.fghrsh.net/2019/07/15/af3d70124d5a87105bcf46849f034183.jpg
18-
https://fp1.fghrsh.net/2019/07/15/736555d3da08e40e5b06f1a3e70a5535.png
19-
https://fp1.fghrsh.net/2019/07/15/cbc748f2a200e5e9bf6a672f3ce409eb.jpg
20-
https://fp1.fghrsh.net/2019/07/15/d4fe1df1e83bf946f2c399511ecd91d7.jpg
21-
https://fp1.fghrsh.net/2019/07/15/91f01e7d3afe41247774932035782356.jpg
22-
https://fp1.fghrsh.net/2019/07/15/a86c6453795236033a99b04eb2011810.jpg
23-
https://fp1.fghrsh.net/2019/07/15/521565e16cee09970f07a5e56f93c9d4.jpg
24-
https://fp1.fghrsh.net/2019/07/15/08210405d613510bed29d96bc01adbf8.jpg
25-
https://fp1.fghrsh.net/2019/07/15/8475093caeadeb7a726b5eec15a95b83.jpg
26-
https://fp1.fghrsh.net/2019/07/15/72d11e153eac56b88f046971b91c8de9.jpg
27-
https://fp1.fghrsh.net/2019/07/15/696b11f4981e9328f4606ef75cc64513.jpg
28-
https://fp1.fghrsh.net/2019/07/15/e4366b941f7c28e9015561ec089b5a13.jpg
29-
https://fp1.fghrsh.net/2019/07/15/3528f668884463c58b32e7a76e165b79.jpg
30-
https://fp1.fghrsh.net/2019/07/15/f92ec798bdb2144e4ec787ee216c360d.jpg
31-
https://fp1.fghrsh.net/2019/07/15/ff8b207c2eee1aadc9e5515a76f3c8cb.jpg
32-
https://fp1.fghrsh.net/2019/07/15/e8569cc2377f273180eb2726637b892c.jpg
33-
https://fp1.fghrsh.net/2019/07/15/c6f72dfd4590dfaaa4dc231150352b83.jpg
34-
https://fp1.fghrsh.net/2019/07/15/880c4d8ecc16600214c952201df21b67.jpg
1+
https://z3.ax1x.com/2021/08/19/fqDBH1.png
2+
https://z3.ax1x.com/2021/08/19/fqD0BR.png
3+
https://z3.ax1x.com/2021/08/19/fqDQns.png
4+
https://z3.ax1x.com/2021/08/19/fqDucQ.png
5+
https://z3.ax1x.com/2021/08/19/fqDsN6.png
6+
https://z3.ax1x.com/2021/08/19/fqDlBn.png
7+
https://z3.ax1x.com/2021/08/19/fqD8A0.png
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{
2-
"functions": {
3-
"api/index.php": {
4-
"runtime": "vercel-php@0.3.1",
5-
"excludeFiles": "{test/**}",
6-
"memory": 256,
7-
"maxDuration": 5
8-
}
9-
},
10-
"routes": [
11-
{
12-
"src": "/(\\w*)\\.(?:jpg|jpeg|png|gif|bmp|webp)",
13-
"dest": "/api/index.php?id=$1"
14-
}
15-
]
16-
}
1+
{
2+
"functions": {
3+
"api/index.php": {
4+
"runtime": "vercel-php@0.4.0",
5+
"excludeFiles": "{test/**}",
6+
"memory": 256,
7+
"maxDuration": 5
8+
}
9+
},
10+
"routes": [
11+
{
12+
"src": "/(\\w*)\\.(?:jpg|jpeg|png|gif|bmp|webp)",
13+
"dest": "/api/index.php?id=$1"
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)