commit 93483996a68b4d9a23450bd825410a64fb88e448 parent 2bb95f2a67850983a86bcd92725b963c7f75d727 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Thu, 12 Apr 2018 10:28:22 -0400 Place forecast functions to separate files Diffstat:
M | links/.zshrc | | | 27 | --------------------------- |
A | links/bin/forecast | | | 14 | ++++++++++++++ |
A | links/bin/forecast-sky | | | 15 | +++++++++++++++ |
3 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/links/.zshrc b/links/.zshrc @@ -137,33 +137,6 @@ function w3mtor { } function w3mddg { torify surfraw ddg $@ } function weather { curl 'wttr.in/?m'; } -function forecast { - local tmpfile=`mktemp`.png - curl --location \ - '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'\ - --output $tmpfile - if command -v open &>/dev/null; then - open $tmpfile - elif command -v xdg-open &>/dev/null; then - xdg-open $tmpfile - else - echo $tmpfile - fi -} -function forecastsky { - local tmpfile=`mktemp`.png - curl --location \ - 'http://www.cleardarksky.com/c/AAAP1_NJcsk.gif?c=468010'\ - --output $tmpfile - if command -v open &>/dev/null; then - open $tmpfile - elif command -v xdg-open &>/dev/null; then - xdg-open $tmpfile - else - echo $tmpfile - fi -} - function define { curl --silent dict://dict.org/d:$1 } function news { local url diff --git a/links/bin/forecast b/links/bin/forecast @@ -0,0 +1,14 @@ +#!/bin/bash -e +# vim: ft=sh: + +tmpfile=`mktemp`.png +curl --location \ + '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'\ + --output $tmpfile +if command -v open &>/dev/null; then + open $tmpfile +elif command -v xdg-open &>/dev/null; then + xdg-open $tmpfile +else + echo $tmpfile +fi diff --git a/links/bin/forecast-sky b/links/bin/forecast-sky @@ -0,0 +1,15 @@ +#!/bin/bash -e +# vim: ft=sh: + +tmpfile=`mktemp`.png +curl --location \ + 'http://www.cleardarksky.com/c/AAAP1_NJcsk.gif?c=468010'\ + --output $tmpfile +if command -v open &>/dev/null; then + open $tmpfile +elif command -v xdg-open &>/dev/null; then + xdg-open $tmpfile +else + echo $tmpfile +fi +