Random-Picture

随机图片api JUST FOR FUN

由UserUnknown进行2次修改的版本(

原著版权声明见预览网页下方

实验地址:

https://random-pic.now.sh/(部署到vercel)

注意:

路径 说明
./url.txt 务必一行一个url,不要输入不完整的url
./api/index.php 修改ALLOW_OUTPUT以开启output

部署到vercel

建议fork后,自行修改配置,然后在vercel平台上导入自己的项目 Deploy with Vercel

直接调用

访问./api即可,跳转至图片地址

访问./api/?id=数字,跳转至指定图片

注:api附加参数 api=数字 亦可跳转至指定图片

如:./api/?type=json&id=3

访问./api/?type=length

返回图片总量,即id的最大值

访问./api/?type=output

服务器读取后输出,一般不建议使用,默认禁用

访问./api/?type=json

服务器输出json

         
{"code":"200","url":"https:\/\/fp1.fghrsh.net\/2019\/07\/15\/c2549aaa63db078834ead6a92fe63b61.jpg"}
    

访问./api/?type=JSON

服务器读取图片信息后输出json,如非需要图片信息不建议使用

         
{"code":"200","url":"https:\/\/fp1.fghrsh.net\/2019\/07\/15\/c2549aaa63db078834ead6a92fe63b61.jpg","width":"1920","height":"1080","mime":"image\/jpeg","size":"821735"}