Bing Wallpaper is very nice, download it every day when the desktop is still good, in fact, the capture image method is very simple, but the image URL still have to do some work to check. Take some time, or find the Bing China HD Wallpaper (1980*1080) address, here is the code for Nodejs to grab the picture:
/* Download Bing China wallpaper To this directory the resolution is 1980*1080, can be set */var http = require (' http '); Var fs = require ( ' FS ');var options = { hostname: ' cn.bing.com ', port: 80, path: '/hpimagearchive.aspx?idx=0&n=1 ', method: ' GET '};var req = http.request (options, function (res) { var reg = new regexp ("<url>/az/hprichbg/rb/(. *) _1366x768.jpg</url> "); var body = '; res.on (' Data ', function ( Chunk) { body += chunk; } ). On (' End ', function () { reg.test (body); var img = RegExp.$1; consolE.log (IMG); writestream = fs.createwritestream (img + "_1920x1080.jpg"); http.get (' http://s.cn.bing.net/ az/hprichbg/rb/' + img + "_1920x1080.jpg", function (RES) { res.pipe (Writestream); }) writestream.on (' Finish ', function () { console.log (' Done '); }); }) res.on (' Error ', function (e) { console.log (e.message); })}); Req.end ();
(⊙o⊙) ..., the code is very small. But get the wallpaper on the line.
Next, there are a few things you can do:
For the win user, you can write a program in C #, set the wallpaper as the system desktop, call the Windows API interface, and then write a scheduled task, execute the bat script every day, script do 2 things, 1:node run the above script download wallpaper, 2, call C # program set wallpaper.
I do not work under win, so C # program does not write:)
Nodejs Download Bing China wallpaper