diff options
| author | yuzu-eva <cafebabe@disroot.org> | 2025-05-08 14:01:37 +0200 |
|---|---|---|
| committer | yuzu-eva <cafebabe@disroot.org> | 2025-05-08 14:01:37 +0200 |
| commit | ef7c1605a027b52bbff1b01ea693b60f53fa3a71 (patch) | |
| tree | 1089334258aefbd459d18cf6968e78f1194739b0 /get-wallpapers | |
initial commit
Diffstat (limited to 'get-wallpapers')
| -rwxr-xr-x | get-wallpapers | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/get-wallpapers b/get-wallpapers new file mode 100755 index 0000000..40eef78 --- /dev/null +++ b/get-wallpapers @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Download wallpapers via the wallhaven API +# Reads search term, start page and end page + +read -p "Enter search term: " search_term +read -p "Enter start page: " start_page +read -p "Enter end page: " end_page + +current_page=$start_page + +while [ $current_page -le $end_page ]; do + curl -s "https://wallhaven.cc/api/v1/search?q=$search_term&page=$current_page" | + jq '.data[].path' | + xargs -I{} curl -O {}; + current_page=$(( current_page+1 )); +done + + + |
