Originally, I had put the second bullet on the top of the list and didn’t intend to post the third bullet, but then I thought about it and held back so many words that I thought it would be a waste of my brain cells if I didn’t post it.
It’s been 2 years since the last update, and the APi has been running smoothly for 2 years and several months. This time the main update is a tutorial picture and 3000+ random secondary api map, in addition and interface optimization, about this!
All images are hosted on Sina Cloud servers with global CDN acceleration, thanks to Fantasy Fields for the upload service!
Interface address:
https://random.52ecy.cn/randbg.php (recommended)
Parameters
Parameter name
Description
size (optional)
Value: 0~7, the thumbnail (size) level of the returned image, the bigger the number the blurrier the image, the smaller the image size, default is 0. e.g., https://random.52ecy.cn/randbg.php?size=4
type (optional)
value: pc, mobile, the type of the returned image, pc for computer wallpaper, mobile for mobile wallpaper (vertical screen), the default is pc. e.g., https://random.52ecy.cn/randbg.php?type=mobile
Extra
Many people have asked me whether open source api, but I do not think it is necessary, even can not be called open source, just a few lines of code, two commands of the matter, sent me too ashamed!
$file_arr = file(‘data.php’); $key = array_rand($file_arr);
Some people may say that there are efficiency problems with the way I write this, I say, when you don’t have hundreds of thousands of images and the file doesn’t exceed tens of megabytes, there is no need to consider efficiency. There are many different ways to do this, and the one that suits you is the best!
Also, the first interface is actually overwhelmed and suspended indefinitely.
The update triggered by an image was really random enough (forced update)
UPDATE.
- March 23, 2020
- update type parameter, value: pc, mobile
- add 1000 mobile images
- add 1000 pc images