dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 027e5b129d51a378f223891e86a11316cf9cdc92
parent 62410b2f445dd8f3af923ed3d9161afe39c4e227
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 14 Aug 2018 15:57:34 +0200

Update bookmarks and add optional arguments to forecast

Diffstat:
Mlinks/.w3m/bookmark.html | 2++
Mlinks/bin/forecast | 28+++++++++++++++++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/links/.w3m/bookmark.html b/links/.w3m/bookmark.html @@ -91,6 +91,8 @@ <ul> <li><a href="https://servlet.dmi.dk/byvejr/servlet/byvejr_dag1?by=9520&mode=long&eps=true">DMI: Skoerping 48h</a> + <li><a href="https://servlet.dmi.dk/byvejr/servlet/byvejr?by=9520&tabel=dag3_9&eps=true">DMI: + Skoerping 3-9d</a> <li><a href="http://www.dmi.dk/vejr/maalinger/radar-nedboer/">DMI: Radar</a> <!-- <li><a href="http://f1.weather.gov/MapClick.php?lat=40.33075000000008&amp;lon=-74.56472999999994">National Weather Service: Plainsboro, NJ</a> --> <!-- <li><a href="http://f1.weather.gov/MapClick.php?w0=t&amp;w1=td&amp;w2=wc&amp;w3=sfcwind&amp;w3u=3&amp;w4=sky&amp;w5=pop&amp;w6=rh&amp;w7=rain&amp;w8=thunder&amp;w9=snow&amp;w10=fzg&amp;w11=sleet&amp;w12=fog&amp;w13u=0&amp;w16u=1&amp;w17u=1&amp;AheadHour=0&amp;Submit=Submit&amp;FcstType=graphical&amp;textField1=40.3308&amp;textField2=-74.5647&amp;site=all&amp;unit=0&amp;dd=&amp;bw=&amp;menu=1">NWS: Hourly Weather Forecast, Plainsboro NJ (Graphical)</a> --> diff --git a/links/bin/forecast b/links/bin/forecast @@ -1,21 +1,35 @@ #!/bin/bash -e # vim: ft=sh: +set -e # DMI #zipcode=7700 # Thisted zipcode=9520 # Skoerping -url="https://servlet.dmi.dk/byvejr/servlet/byvejr_dag1?by=$zipcode&mode=long&eps=true" +url="https://servlet.dmi.dk/byvejr/servlet/byvejr_dag1?by=${zipcode}&mode=long&eps=true" # NWS: Plainsboro #url='http://f1.weather.gov/meteograms/Plotter.php?lat=40.3308&lon=-74.5647&wfo=PHI&zcode=NJZ012&gset=20&gdiff=10&unit=0&tinfo=EY5&ahour=0&pcmd=11011111111110100000000000000000000000000000000000000000000&lg=en&indu=3!1!1!&dd=&bw=&hrspan=48&pqpfhr=6&psnwhr=6' -tmpfile=$(mktemp).png -curl --location "$url" \ - --output "$tmpfile" if command -v open &>/dev/null; then - open "$tmpfile" + open=open elif command -v xdg-open &>/dev/null; then - xdg-open "$tmpfile" + open=xdg-open else - echo "$tmpfile" + open="echo" +fi + +if [ $# -gt 0 ]; then + if [ "$1" == "radar" ]; then + $open "http://www.dmi.dk/vejr/maalinger/radar-nedboer/" + exit 0 + elif [ "$1" == "3-9" ]; then + url="https://servlet.dmi.dk/byvejr/servlet/byvejr?by=${zipcode}&tabel=dag3_9&eps=true" + fi fi + +tmpfile=$(mktemp).png +curl --location "$url" \ + --output "$tmpfile" +$open "$tmpfile" + +#http://servlet.dmi.dk/byvejr/servlet/byvejr?by=9520&tabel=dag3_9&eps=true