当前位置:网站首页>Build your own random wallpaper API for free
Build your own random wallpaper API for free
2022-07-05 07:30:00 【SongErrors】
Use github Store image +jsdelivr CDN To speed up access
Come to my station to read : Early station
1、 Create a new one github Open warehouse
Such as wallpaper-transverse
2、 Upload picture files to github Warehouse
Before uploading, the file processing batch command is 0.jpg、1.jpg2、2.jpg……
3、 To configure jsdelivr Speed up
Copy any picture and link to https://www.jsdelivr.com/github convert to jsdelivr link

Such as https://github.com/UniqueYou/wallpaper-transverse/blob/main/0.jpg Convert to
https://cdn.jsdelivr.net/gh/UniqueYou/[email protected]/0.jpg
4、 Create a random.php File upload to web The server
[scode type=“blue”] Need to change to your own $picpath Address and random number [/scode]
<?php
// Initialize the random number generator , This line of code can also be deleted
$seed = time();
// Get random numbers
$num = mt_rand(0,98);
// Splice picture address
$picpath = "https://cdn.jsdelivr.net/gh/UniqueYou/[email protected]/".$num.".jpg";
// Relocate to picture
die(header("Location: $picpath"));
?>
[scode type=“green”] Recommended mt_rand() instead of rand()[/scode]mt_rand() Function USES Mersenne Twister The algorithm generates random integers .
Tips : This function is a better choice for generating random values , The speed of returning results is rand() Functional 4 times . Tips : If you want one between 10 and 100 Between ( Include 10 and 100) Random integer of , Please use mt_rand (10,100).
[scode type=“green”] You can also use my API[/scode]
https://www.songonline.top/random.php
边栏推荐
- [vscode] search using regular expressions
- Clickhouse database installation deployment and remote IP access
- 公安专业知识--哔哩桐老师
- Raspberry pie 4B arm platform aarch64 PIP installation pytorch
- deepin 20 kivy unable to get a window, abort
- Machine learning Seaborn visualization
- And play the little chestnut of dynamic agent
- Delayqueue usage and scenarios of delay queue
- CADD课程学习(6)-- 获得已有的虚拟化合物库(Drugbank、ZINC)
- Cookie operation
猜你喜欢

611. Number of effective triangles

HDU1232 畅通工程(并查集)

M2dgr slam data set of multi-source and multi scene ground robot

【idea】Could not autowire. No beans of xxx type found

Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
![When jupyter notebook is encountered, erroe appears in the name and is not output after running, but an empty line of code is added downward, and [] is empty](/img/fe/fb6df31c78551d8908ba7964c16180.jpg)
When jupyter notebook is encountered, erroe appears in the name and is not output after running, but an empty line of code is added downward, and [] is empty

Negative number storage and type conversion in programs

Altimeter data knowledge point 2

Set theory of Discrete Mathematics (I)

DataGrid offline installation of database driver
随机推荐
What is soda?
UNIX commands often used in work
PostMessage communication
Chapter 2: try to implement a simple bean container
Eclipse project recompile, clear cache
苏打粉是什么?
Reading literature sorting 20220104
Deepin get file (folder) list
DataGrid offline installation of database driver
Install deeptools in CONDA mode
SOC_ SD_ DATA_ FSM
ModuleNotFoundError: No module named ‘picamera‘
selenium 元素定位
Cookie operation
Import CV2, prompt importerror: libcblas so. 3: cannot open shared object file: No such file or directory
M2DGR 多源多场景 地面机器人SLAM数据集
Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
Basic knowledge of public security -- FB
With the help of Navicat for MySQL software, the data of a database table in different or the same database link is copied to another database table
2022 PMP project management examination agile knowledge points (7)