This Gist contains a bash and a fish shell script to get MS Spotlight photos on your Linux machine.
Depends on curl, jq and sed.
#!/usr/bin/fish | |
argparse 'h/help' 'd/destination' -- $argv | |
if [ "$argv" = "" ] | |
set argv /usr/share/backgrounds/spotlight.jpg | |
end | |
set date (date +'%Y-%m-%dT%H:%M:%SZ') | |
set wallpaper (curl -s "https://arc.msn.com/v3/Delivery/Cache?pid=209567&fmt=json&rafb=0&ua=WindowsShellClient%2F0&disphorzres=9999&dispvertres=9999&lo=80217&pl=en-US&lc=hu-HU&ctry=hu&time=$date" | jq .batchrsp.items[0].item | sed 's/\\\\"/"/g' | sed 's/^\"//' | sed 's/\"$//' | jq -r .ad.image_fullscreen_001_landscape.u) | |
curl -s "$wallpaper" -o $argv |
#!/usr/bin/bash | |
destination=/usr/share/backgrounds/spotlight.jpg | |
while getopts "d:" OPTION; do | |
case "$OPTION" in | |
d) | |
destination=$OPTARG | |
;; | |
\?) echo "Usage: cmd [-d]" | |
;; | |
esac | |
done | |
date=$(date +'%Y-%m-%dT%H:%M:%SZ') | |
wallpaper=$(curl -s "https://arc.msn.com/v3/Delivery/Cache?pid=209567&fmt=json&rafb=0&ua=WindowsShellClient%2F0&disphorzres=9999&dispvertres=9999&lo=80217&pl=en-US&lc=hu-HU&ctry=hu&time=$date" | jq .batchrsp.items[0].item | sed 's/\\\\"/"/g' | sed 's/^\"//' | sed 's/\"$//' | jq -r .ad.image_fullscreen_001_landscape.u) | |
curl -s "$wallpaper" -o $destination |