Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion waldl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ sorting=relevance
quality=large
# atleast : least res
atleast=1920x1080
# add your apikey
apikey=""

# allow the user to customize the defaults
[ -e "$HOME/.config/waldlrc" ] && . "$HOME/.config/waldlrc"
Expand Down Expand Up @@ -90,12 +92,16 @@ trap "clean_up" EXIT
## getting data ##
##################

full_link="https://wallhaven.cc/api/v1/search"
if [ "$apikey" != "" ]; then
full_link="$full_link""?apikey=""$apikey"
fi
# request the search results for each page
get_results () {
for page_no in $(seq $max_pages)
do
{
json=$(curl -s -G "https://wallhaven.cc/api/v1/search" \
json=$(curl -s -G "$full_link" \
-d "q=$1" \
-d "page=$page_no" \
-d "atleast=$atleast" \
Expand Down