当前位置:网站首页>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
边栏推荐
- 并查集理论讲解和代码实现
- CADD课程学习(6)-- 获得已有的虚拟化合物库(Drugbank、ZINC)
- golang定时器使用踩的坑:定时器每天执行一次
- selenium 元素定位
- Light up the running light, rough notes for beginners (1)
- Eclipse project recompile, clear cache
- Detailed explanation of miracast Technology (I): Wi Fi display
- Set theory of Discrete Mathematics (I)
- Deepin get file (folder) list
- What is sodium hydroxide?
猜你喜欢

Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4

The number of occurrences of numbers in the offer 56 array (XOR)

Don't confuse the use difference between series / and / *

SOC_ SD_ DATA_ FSM

Word import literature -mendeley

Microservice registry Nacos introduction

I 用c I 实现队列

UE5热更新-远端服务器自动下载和版本检测(SimpleHotUpdate)

Using GEE plug-in in QGIS

DataGrid offline installation of database driver
随机推荐
I 用c I 实现队列
2022.06.27_ One question per day
What if the DataGrid cannot see the table after connecting to the database
Daily Practice:Codeforces Round #794 (Div. 2)(A~D)
Machine learning Seaborn visualization
The SQL implementation has multiple records with the same ID, and the latest one is taken
Rough notes of C language (1)
Clickhouse database installation deployment and remote IP access
Ugnx12.0 initialization crash, initialization error (-15)
[node] NVM version management tool
arcgis_ spatialjoin
Tshydro tool
公安专业知识--哔哩桐老师
611. Number of effective triangles
Matrix keyboard scan (keil5)
氢氧化钠是什么?
PostMessage communication
Graduation thesis project local deployment practice
[framework] multi learner
I can't stand the common annotations of idea anymore