In the past I was able to get every day a new wallpaper from National Geo.
Unfortunately Bing and Ng coded that stuff so it’s not easy to fetch the data to download. The code below was tweaked but not written by myself. I’d give credits but it’s long time ago, so I can’t remember anymore the original source
set WallPaper to POSIX path of (path to temporary items folder from user domain as text)
set cmd to "#!/bin/sh\ncd " & WallPaper & ";\ncurl http://photography.nationalgeographic.com/photography/photo-of-the-day/ -o pod\n# look for wallpaper version\nif (curl `cat pod | tr '\"' '\n' |grep -B 1 'Download wallpaper' | head -1` -o pod2) then\n\tcat pod2 | tr '\"' '\n' |grep -oh 'http://.*exposure.*.jpg' |head -1 | sed 's/0_360x270/0_1440x900/'\n\ta=`cat pod2 | tr '\"' '\n' |grep -B 4 -A 4 'Desktop Wallpaper' | grep '.jpg' | sed 's/0_1600x1200/0_1440x900/'`\n\tcurl 'http://photography.nationalgeographic.com/'$a -o national-geographic-photo-of-the-day.jpg;\nelse\n\t# download the image from here --- in case it is not a wallpaper\n\ta=`cat pod|tr '\"' '\n' |grep -A 20 \"primary_photo\"|grep nationalgeographic.com`\n\tcurl 'http:'$a -o national-geographic-photo-of-the-day.jpg;\nfi\n"
That first URL returns a page saying that the URL has changed permanently to “http://www.nationalgeographic.com/photography/photo-of-the-day/” (ie. “www” instead of "photography.) The new URL opens in my browser, but doesn’t send anything when curl-ed in that way.
Francv, I appreciate your thought.
Just as said before, both websites wrapped their daily pictures around a code, so a normal Curl doesn’t work. I mean, of course you can try but all you get will be an empty file. Anyway.
Merry Christmas!