当前位置:网站首页>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
边栏推荐
- list. files: List the Files in a Directory/Folder
- DataGrid offline installation of database driver
- 苏打粉是什么?
- Today, share the wonderful and beautiful theme of idea + website address
- Course learning accumulation ppt
- M2dgr slam data set of multi-source and multi scene ground robot
- Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
- I 用c l 栈与队列的相互实现
- Shadowless cloud desktop - online computer
- How can Oracle SQL statements modify fields that are not allowed to be null to allow nulls?
猜你喜欢

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

Delayqueue usage and scenarios of delay queue

Concurrent programming - deadlock troubleshooting and handling

The folder directly enters CMD mode, with the same folder location

【Node】nvm 版本管理工具

Tshydro tool

Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘

Concurrent programming - how to interrupt / stop a running thread?

611. 有效三角形的个数

HDU1232 畅通工程(并查集)
随机推荐
UNIX commands often used in work
CADD课程学习(5)-- 构建靶点已知的化合结构(ChemDraw)
Word import literature -mendeley
Ethtool principle introduction and troubleshooting ideas for network card packet loss (with ethtool source code download)
Ggplot2 drawing learning notes in R
行测--资料分析--fb--高照老师
How to deal with excessive memory occupation of idea and Google browser
2022.06.27_每日一题
[software testing] 02 -- software defect management
[node] NVM version management tool
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
CADD course learning (5) -- Construction of chemosynthesis structure with known target (ChemDraw)
Course learning accumulation ppt
Chapter 2: try to implement a simple bean container
What if the DataGrid cannot see the table after connecting to the database
DelayQueue延迟队列的使用和场景
Qu'est - ce que l'hydroxyde de sodium?
UE5热更新-远端服务器自动下载和版本检测(SimpleHotUpdate)
I implement queue with C I
[idea] efficient plug-in save actions to improve your work efficiency