First, create a directory at the root of your device called apod.
Task:
Task name: Set APOD
A1: Variable Set [ Name:%apod_path To:apod/apod.jpg Recurse Variables:Off Do Maths:Off Append:Off ]
A2: HTTP Get [
Server:Port:https://apod.nasa.gov/ Timeout:10 Mime Type:text/html Trust Any Certificate:Off ]
A3: Variable Set [ Name:%httpd To:%HTTPD Recurse Variables:Off Do Maths:Off Append:Off ]
A4: Variable Clear [ Name:%HTTPD Pattern Matching:Off Local Variables Only:Off ]
A5: Variable Search Replace [ Variable:%httpd Search:\<img
src="([^"]+)" Ignore Case:On Multi-Line:Off One Match Only:On Store
Matches In:%imagesource Replace Matches:Off ]
A6: Variable Search
Replace [ Variable:%imagesource1 Search:"([^"]+)" Ignore Case:Off
Multi-Line:Off One Match Only:On Store Matches In:%imagename Replace
Matches:Off ]
A7: Variable Search Replace [ Variable:%imagename1
Search:" Ignore Case:Off Multi-Line:Off One Match Only:Off Replace
Matches:On Replace With: ]
A8: HTTP Get [
Server:Port:https://apod.nasa.gov/%imagename1 Timeout:10 Mime Type:image/jpeg Output File:%apod_path Trust Any Certificate:Off ]
A9: Set Wallpaper [ Type:All Image:%apod_path Scale:On Crop:Off ]
First HTTP Get action - retrieve the content of the page so the task can find the path of the file.
First Variable Search Replace action - get the first string containing <img src="..." in the page. Variable %imagesource1 will contain this part of the HTML tag.
Second Variable Search Replace action - get only the string enclosed in quotes (will be in variable %imagename1).
Third Variable Search Replace action - remove the quotes from the filename - search for " and Replace With is empty - now %imagename1 contains the path of the file without quotes.
Second HTTP Get action - get the image as text/jpeg and save as a file.
Bill