diff options
Diffstat (limited to 'brweather/bin/inpe-1')
-rw-r--r-- | brweather/bin/inpe-1 | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/brweather/bin/inpe-1 b/brweather/bin/inpe-1 new file mode 100644 index 0000000..471edf7 --- /dev/null +++ b/brweather/bin/inpe-1 @@ -0,0 +1,200 @@ +#!/bin/bash +# BrWeather Modo INPE +# Criado por LeandroNKZ <leandronkz@gmail.com> +# Se encontrar BUGs, ou erros no programa, favor reportar ao desenvolvedor +# Acesse o site para maiores instruções: +# http://brweatherproject.blogspot.com/ +# Distribuído sob licença GPLv3 + + +NCITY=`grep -m1 -A1 '<div id="subcid">' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | tail -n1` +NDATE=`date "+%d-%m-%Y"` +NLU=`cat ~/.brweather/cache/lastupdate` +LUS=`grep -m1 'height="3px" />Atualizado:' ~/.brweather/cache/cache | cut -f2 -d':' | cut -f1 -d'<' | sed 's/ //'` + +NTN=`grep '</b> TEMPERATURA</div>' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'C' | sed 's/º//g'` +STE=`grep -m1 'SENSAÇÃO TÉRMICA' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'C' | sed 's/º//g'` +NUMID=`grep 'UMIDADE RELATIVA </div>' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<' | sed 's/%//g'` +NPA=`grep -m1 'PRESSÃO ATMOSFÉRICA ' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<'` +NWINDD=`grep -m1 '<div id="c5">' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<'` +NWINDS=`grep -m1 '<div id="c5">' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'` + +DAY0=`date "+%a"` +DAY0T=`date +%A | sed -r 's/\b[a-z]{3,}/\u&/g'` +DVOLATIL=`grep -m1 '<div id="prev_ond"><div id="tit">' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'-' | sed 's/ //g'` + + +case $DVOLATIL in +"Domingo") + DAY1="Dom" + DAY1T="Domingo" + DAY2="Seg" + DAY2T="Segunda" + DAY3="Ter" + DAY3T="Terça" + DAY4="Qua" + DAY4T="Quarta" + DAY5="Qui" + DAY5T="Quinta" + DAY6="Sex" + DAY6T="Sexta" + DAY7="Sáb" + DAY7T="Sábado" +;; +"Segunda") + DAY1="Seg" + DAY1T="Segunda" + DAY2="Ter" + DAY2T="Terça" + DAY3="Qua" + DAY3T="Quarta" + DAY4="Qui" + DAY4T="Quinta" + DAY5="Sex" + DAY5T="Sexta" + DAY6="Sáb" + DAY6T="Sábado" + DAY7="Dom" + DAY7T="Domingo" +;; +"Terça") + DAY1="Ter" + DAY1T="Terça" + DAY2="Qua" + DAY2T="Quarta" + DAY3="Qui" + DAY3T="Quinta" + DAY4="Sex" + DAY4T="Sexta" + DAY5="Sáb" + DAY5T="Sábado" + DAY6="Dom" + DAY6T="Domingo" + DAY7="Seg" + DAY7T="Segunda" +;; +"Quarta") + DAY1="Qua" + DAY1T="Quarta" + DAY2="Qui" + DAY2T="Quinta" + DAY3="Sex" + DAY3T="Sexta" + DAY4="Sáb" + DAY4T="Sábado" + DAY5="Dom" + DAY5T="Domingo" + DAY6="Seg" + DAY6T="Segunda" + DAY7="Ter" + DAY7T="Terça" +;; +"Quinta") + DAY1="Qui" + DAY1T="Quinta" + DAY2="Sex" + DAY2T="Sexta" + DAY3="Sáb" + DAY3T="Sábado" + DAY4="Dom" + DAY4T="Domingo" + DAY5="Seg" + DAY5T="Segunda" + DAY6="Ter" + DAY6T="Terça" + DAY7="Qua" + DAY7T="Quarta" +;; +"Sexta") + DAY1="Sex" + DAY1T="Sexta" + DAY2="Sáb" + DAY2T="Sábado" + DAY3="Dom" + DAY3T="Domingo" + DAY4="Seg" + DAY4T="Segunda" + DAY5="Ter" + DAY5T="Terça" + DAY6="Qua" + DAY6T="Quarta" + DAY7="Qui" + DAY7T="Quinta" +;; +"Sábado") + DAY1="Sáb" + DAY1T="Sábado" + DAY2="Dom" + DAY2T="Domingo" + DAY3="Seg" + DAY3T="Segunda" + DAY4="Ter" + DAY4T="Terça" + DAY5="Qua" + DAY5T="Quarta" + DAY6="Qui" + DAY6T="Quinta" + DAY7="Sex" + DAY7T="Sexta" +;; +esac + + +case $1 in +"--option=city") echo $NCITY +;; +"--option=date") echo $NDATE +;; +"--option=Day0") echo $DAY0 +;; +"--option=Day0T") echo $DAY0T +;; +"--option=LU") echo $NLU +;; +"--option=LUS") echo $LUS +;; +"--option=TN") echo $NTN +;; +"--option=STE") echo $STE +;; +"--option=umid") echo $NUMID +;; +"--option=PA") echo $NPA +;; +"--option=windd") echo $NWINDD +;; +"--option=winds") echo $NWINDS +;; +"--option=Day1") echo $DAY1 +;; +"--option=Day1T") echo $DAY1T +;; +"--option=Day2") echo $DAY2 +;; +"--option=Day2T") echo $DAY2T +;; +"--option=Day3") echo $DAY3 +;; +"--option=Day3T") echo $DAY3T +;; +"--option=Day4") echo $DAY4 +;; +"--option=Day4T") echo $DAY4T +;; +"--option=Day5") echo $DAY5 +;; +"--option=Day5T") echo $DAY5T +;; +"--option=Day6") echo $DAY6 +;; +"--option=Day6T") echo $DAY6T +;; +"--option=Day7") echo $DAY7 +;; +"--option=Day7T") echo $DAY7T +;; +"--option"* ) echo "Opção inválida. +Experimente --help para mais informações." +;; +esac +exit 0 |