Skip to content

Commit

Permalink
🐛 polybar[weather]: make request using random num
Browse files Browse the repository at this point in the history
This ensures nothing gets cached on their end and that the request will go through
  • Loading branch information
cristianmiranda committed May 22, 2024
1 parent eed79a1 commit 774e5c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions home/.config/polybar/scripts/weather
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

RANDOM_NUMBER=$(shuf -i 1-999999 -n 1);
WEATHER=$(curl -s "wttr.in/?format=1&random=$RANDOM_NUMBER");

WEATHER=$(curl -s "wttr.in/?format=1");

if [[ "$WEATHER" =~ "Unknown" || "$WEATHER" =~ "Sorry" ]]; then
if [[ "$WEATHER" =~ "Unknown" || "$WEATHER" =~ "Sorry" ]]; then
echo "🌪️"
else
echo $WEATHER;
else
echo $WEATHER;
fi

0 comments on commit 774e5c1

Please sign in to comment.