News for hackers. Stuff that matters.
Re:Gallery-dl – download images from several image hosting s... by aomega08 on Sunday November 29, 2020 @09:12AM (#25245193)
The following will give you "#1 wallpaper of the day" as decided by the wise folks at Reddit:

  curl -A 'random' "https://www.reddit.com/r/wallpaper/top.json?t=day&limit=1 | jq -r '.data.children[0].data.preview.images[0].source.url' | sed 's/preview\./i\./g'
And if you're a Mac user, the following will change the background:

  osascript -e 'tell application "Finder" to set desktop picture to POSIX file "<path to the picture>"'
Glueing these two pieces should be trivial :)
Re:Gallery-dl – download images from several image hosting s... by hyiltiz on Sunday November 29, 2020 @08:05PM (#25249726)
The call to curl is missing a closing " pair. Besides, it seems some people submit a low-res image at the post, then post another link as the first reply, which is the case today:

https://preview.redd.it/b2ihaxu2i5261.jpg?width=640&crop=sma...

Care to adjust the jq a bit to look for both, then maybe somehow compare the resolution of the two and download the better one?