aboutsummaryrefslogtreecommitdiff
path: root/weather-forecast
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-20 21:02:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-20 21:02:00 -0300
commit0220c9924c6fb633e7cd55be548a1604fdf4f63c (patch)
tree08d2f1e4b5c5b1c3556fc81893619e73b0835285 /weather-forecast
parente851401694daacaf1aba2c87ed557e5dbf00af02 (diff)
downloadscripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.gz
scripts-0220c9924c6fb633e7cd55be548a1604fdf4f63c.tar.bz2
Move scripts to other repositories (2)
Diffstat (limited to 'weather-forecast')
-rwxr-xr-xweather-forecast36
1 files changed, 0 insertions, 36 deletions
diff --git a/weather-forecast b/weather-forecast
deleted file mode 100755
index 269f740..0000000
--- a/weather-forecast
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-#
-# Simple wrapper around wttr.in
-#
-
-# Parameters
-BASENAME="`basename $0`"
-PROGRAM="$1"
-CACHE="$HOME/.local/share/weather"
-
-# Load config
-source $HOME/.custom/wttr.in.conf || exit 1
-
-# weather-forecast service query
-function weather_forecast_query {
- # Make sure everything we need exists
- mkdir -p $CACHE
- touch $CACHE/weather-forecast.cur $CACHE/weather-forecast.prev
-
- # Save the previous forecast
- cp $CACHE/weather-forecast.cur $CACHE/weather-forecast.prev
- curl wttr.in/$LOCATION > $CACHE/weather-forecast.cur 2> /dev/null
-
- # Test if current forecast is empty, meaning
- # that we're probably ofline. In that case
- # we provide the previous output.
- if [ ! -s "$CACHE/weather-forecast.cur" ]; then
- cp $CACHE/weather-forecast.prev $CACHE/weather-forecast.cur
- fi
-
- # Display output
- cat $CACHE/weather-forecast.cur
-}
-
-# Main
-weather_forecast_query