Skip to content

Instantly share code, notes, and snippets.

@tail-call
Created August 1, 2016 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tail-call/48426cfd12696940b7417a37f8b741f4 to your computer and use it in GitHub Desktop.
Save tail-call/48426cfd12696940b7417a37f8b741f4 to your computer and use it in GitHub Desktop.
Pony wallpapers!
#!/bin/sh
curl "https://derpibooru.org/tags/wallpaper/random_img.json?filter_id=56027" |
sed -e 's/{"id":"\([0-9]*\)"}/https:\/\/derpibooru.org\/\1.json\n/g' |
xargs curl |
# -P switch for Perl syntax (.*? - non-greedy match)
grep -o -P '"image":".*?"' |
sed -e 's/"image":"\(.*\)"/https:\1/' |
xargs feh --bg-fill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment