aboutsummaryrefslogtreecommitdiff
path: root/brweather/bin
diff options
context:
space:
mode:
Diffstat (limited to 'brweather/bin')
-rw-r--r--brweather/bin/inpe-159
-rwxr-xr-xbrweather/bin/inpe-2144
-rwxr-xr-xbrweather/bin/inpe-379
-rw-r--r--brweather/bin/inpe-44
-rw-r--r--brweather/bin/inpe-61
-rwxr-xr-xbrweather/bin/moon1
-rw-r--r--brweather/bin/open-1160
-rwxr-xr-xbrweather/bin/open-285
-rw-r--r--brweather/bin/open-31
-rw-r--r--brweather/bin/open-41
-rw-r--r--brweather/bin/open-51
11 files changed, 219 insertions, 317 deletions
diff --git a/brweather/bin/inpe-1 b/brweather/bin/inpe-1
index 471edf7..047961c 100644
--- a/brweather/bin/inpe-1
+++ b/brweather/bin/inpe-1
@@ -6,26 +6,10 @@
# 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&nbsp' ~/.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")
+"Domingo")
DAY1="Dom"
DAY1T="Domingo"
DAY2="Seg"
@@ -41,7 +25,7 @@ case $DVOLATIL in
DAY7="Sáb"
DAY7T="Sábado"
;;
-"Segunda")
+"Segunda")
DAY1="Seg"
DAY1T="Segunda"
DAY2="Ter"
@@ -57,7 +41,7 @@ case $DVOLATIL in
DAY7="Dom"
DAY7T="Domingo"
;;
-"Terça")
+"Terça")
DAY1="Ter"
DAY1T="Terça"
DAY2="Qua"
@@ -73,7 +57,7 @@ case $DVOLATIL in
DAY7="Seg"
DAY7T="Segunda"
;;
-"Quarta")
+"Quarta")
DAY1="Qua"
DAY1T="Quarta"
DAY2="Qui"
@@ -89,7 +73,7 @@ case $DVOLATIL in
DAY7="Ter"
DAY7T="Terça"
;;
-"Quinta")
+"Quinta")
DAY1="Qui"
DAY1T="Quinta"
DAY2="Sex"
@@ -105,7 +89,7 @@ case $DVOLATIL in
DAY7="Qua"
DAY7T="Quarta"
;;
-"Sexta")
+"Sexta")
DAY1="Sex"
DAY1T="Sexta"
DAY2="Sáb"
@@ -121,7 +105,7 @@ case $DVOLATIL in
DAY7="Qui"
DAY7T="Quinta"
;;
-"Sábado")
+"Sábado")
DAY1="Sáb"
DAY1T="Sábado"
DAY2="Dom"
@@ -141,29 +125,34 @@ esac
case $1 in
-"--option=city") echo $NCITY
+"--option=city") grep -m1 -A1 '<div id="subcid">' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=date") echo $NDATE
+"--option=date") date "+%d-%m-%Y"
;;
-"--option=Day0") echo $DAY0
+"--option=Day0") date "+%a"
;;
-"--option=Day0T") echo $DAY0T
+"--option=Day0T") date +%A | sed -r 's/\b[a-z]{3,}/\u&/g'
;;
-"--option=LU") echo $NLU
+"--option=LU") cat ~/.brweather/cache/lastupdate
;;
-"--option=LUS") echo $LUS
+"--option=LUS")
+ if [ $OPEN == "2" ]; then
+ grep -m1 '<i>IUV com Nuvem</i><br>' ~/.brweather/cache/cache | cut -f5 -d'>' | cut -f1 -d'<'
+ else
+ grep -m1 'height="3px" />Atualizado:' ~/.brweather/cache/cache | cut -f2 -d':' | cut -f1 -d'<' | sed 's/ //'
+ fi
;;
-"--option=TN") echo $NTN
+"--option=TN") grep '</b> TEMPERATURA</div>' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
-"--option=STE") echo $STE
+"--option=STE") grep -m1 'SENSAÇÃO TÉRMICA' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
-"--option=umid") echo $NUMID
+"--option=umid") grep 'UMIDADE RELATIVA </div>' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<' | sed 's/%//g'
;;
-"--option=PA") echo $NPA
+"--option=PA") grep -m1 'PRESSÃO ATMOSFÉRICA&nbsp' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<'
;;
-"--option=windd") echo $NWINDD
+"--option=windd") grep -m1 '<div id="c5">' ~/.brweather/cache/cache | cut -f3 -d'>' | cut -f1 -d'<'
;;
-"--option=winds") echo $NWINDS
+"--option=winds") grep -m1 '<div id="c5">' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
"--option=Day1") echo $DAY1
;;
diff --git a/brweather/bin/inpe-2 b/brweather/bin/inpe-2
index 0749ceb..f58078d 100755
--- a/brweather/bin/inpe-2
+++ b/brweather/bin/inpe-2
@@ -6,25 +6,7 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
-
-NUMID1=`grep -m1 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'`
-NUMID2=`grep -m2 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-NUMID3=`grep -m3 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-NUMID4=`grep -m4 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-NUMID5=`grep -m5 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-NUMID6=`grep -m6 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-NUMID7=`grep -m7 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-NPC1=`grep -m1 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC2=`grep -m2 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC3=`grep -m3 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC4=`grep -m4 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC5=`grep -m5 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC6=`grep -m6 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-NPC7=`grep -m7 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'`
-
-NLT1=`grep -A2 -m1 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | tail -n1 | sed 's/ //g ; s/º//g ; s/C//g'`
-NHT1=`grep -m1 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g'`
+LT1=`grep -A2 -m1 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | tail -n1 | sed 's/ //g ; s/º//g ; s/C//g'`
if [ -f $NLT1 ] ; then
LT1="ND"
@@ -32,132 +14,90 @@ else
LT1="$NLT1"
fi
-NLT2=`grep -m2 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT2=`grep -m2 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-NLT3=`grep -m3 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT3=`grep -m3 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-NLT4=`grep -m4 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT4=`grep -m4 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-NLT5=`grep -m5 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT5=`grep -m5 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-NLT6=`grep -m6 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT6=`grep -m6 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-NLT7=`grep -m7 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-NHT7=`grep -m7 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1`
-
-SOLN1=`grep -m1 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'`
-SOLP1=`grep -m1 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'`
-
-SOLN2=`grep -m2 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP2=`grep -m2 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-SOLN3=`grep -m3 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP3=`grep -m3 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-SOLN4=`grep -m4 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP4=`grep -m4 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-SOLN5=`grep -m5 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP5=`grep -m5 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-SOLN6=`grep -m6 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP6=`grep -m6 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-SOLN7=`grep -m7 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-SOLP7=`grep -m7 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1`
-
-
-
-
case $1 in
"--option=LT1") echo $LT1
;;
-"--option=HT1") echo $NHT1
+"--option=HT1") grep -m1 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
-"--option=PC1") echo $NPC1
+"--option=PC1") grep -m1 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid1") echo $NUMID1
+"--option=umid1") grep -m1 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
-"--option=SOLN1") echo $SOLN1
+"--option=SOLN1") grep -m1 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
-"--option=SOLP1") echo $SOLP1
+"--option=SOLP1") grep -m1 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
-"--option=LT2") echo $NLT2
+"--option=LT2") grep -m2 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT2") echo $NHT2
+"--option=HT2") grep -m2 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC2") echo $NPC2
+"--option=PC2") grep -m2 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid2") echo $NUMID2
+"--option=umid2") grep -m2 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN2") echo $SOLN2
+"--option=SOLN2") grep -m2 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP2") echo $SOLP2
+"--option=SOLP2") grep -m2 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=LT3") echo $NLT3
+"--option=LT3") grep -m3 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT3") echo $NHT3
+"--option=HT3") grep -m3 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC3") echo $NPC3
+"--option=PC3") grep -m3 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid3") echo $NUMID3
+"--option=umid3") grep -m3 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN3") echo $SOLN3
+"--option=SOLN3") grep -m3 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP3") echo $SOLP3
+"--option=SOLP3") grep -m3 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=LT4") echo $NLT4
+"--option=LT4") grep -m4 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT4") echo $NHT4
+"--option=HT4") grep -m4 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC4") echo $NPC4
+"--option=PC4") grep -m4 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid4") echo $NUMID4
+"--option=umid4") grep -m4 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN4") echo $SOLN4
+"--option=SOLN4") grep -m4 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP4") echo $SOLP4
+"--option=SOLP4") grep -m4 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=LT5") echo $NLT5
+"--option=LT5") grep -m5 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT5") echo $NHT5
+"--option=HT5") grep -m5 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC5") echo $NPC5
+"--option=PC5") grep -m5 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid5") echo $NUMID5
+"--option=umid5") grep -m5 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN5") echo $SOLN5
+"--option=SOLN5") grep -m5 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP5") echo $SOLP5
+"--option=SOLP5") grep -m5 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=LT6") echo $NLT6
+"--option=LT6") grep -m6 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT6") echo $NHT6
+"--option=HT6") grep -m6 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC6") echo $NPC6
+"--option=PC6") grep -m6 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid6") echo $NUMID6
+"--option=umid6") grep -m6 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN6") echo $SOLN6
+"--option=SOLN6") grep -m6 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP6") echo $SOLP6
+"--option=SOLP6") grep -m6 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=LT7") echo $NLT7
+"--option=LT7") grep -m7 '<div id="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=HT7") echo $NHT7
+"--option=HT7") grep -m7 '<div id="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
-"--option=PC7") echo $NPC7
+"--option=PC7") grep -m7 '/imgs/pixel.gif" width="30px" height="10px" border="0"/>' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<' | sed 's/ //g' | tail -n1 | sed 's/%//g'
;;
-"--option=umid7") echo $NUMID7
+"--option=umid7") grep -m7 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLN7") echo $SOLN7
+"--option=SOLN7") grep -m7 '<div id="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
-"--option=SOLP7") echo $SOLP7
+"--option=SOLP7") grep -m7 '<div id="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option"* ) echo "Opção inválida.
Experimente --help para mais informações."
diff --git a/brweather/bin/inpe-3 b/brweather/bin/inpe-3
index 4a2a11e..3cff051 100755
--- a/brweather/bin/inpe-3
+++ b/brweather/bin/inpe-3
@@ -7,17 +7,19 @@
# Distribuído sob licença GPLv3
##Radiação ultravioleta
+
+
+
+if [ $1 = "--option=UVN" ] || [ $1 = "--option=UVNT" ] ; then
+
+if [ $OPEN = "0" ] ; then
UVN=`grep -m1 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f13 -d'/' | cut -f1 -d'.'`
-UV1=`grep -m2 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV2=`grep -m3 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV3=`grep -m4 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV4=`grep -m5 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV5=`grep -m6 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV6=`grep -m7 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
-UV7=`grep -m8 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+elif [ $OPEN = "2" ] ; then
+UVN=`grep -m1 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/menor/' ~/.brweather/cache/cache | cut -f16 -d'/' | cut -f1 -d'.'`
+fi
case $UVN in
-"uv_0")
+"uv_0")
NUVN="ND"
NUVNT="ND"
;;
@@ -37,7 +39,7 @@ case $UVN in
NUVN="1"
NUVNT="Baixo"
;;
-"uv_2")
+"uv_2")
NUVN="2"
NUVNT="Baixo"
;;
@@ -91,10 +93,10 @@ case $UVN in
;;
esac
-
-
+elif [ $1 = "--option=UV1" ] || [ $1 = "--option=UV1T" ] ; then
+UV1=`grep -m2 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
case $UV1 in
-"uv_0")
+"uv_0")
NUV1="ND"
NUV1T="ND"
;;
@@ -114,7 +116,7 @@ case $UV1 in
NUV1="1"
NUV1T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV1="2"
NUV1T="Baixo"
;;
@@ -168,8 +170,13 @@ case $UV1 in
;;
esac
+
+
+elif [ $1 = "--option=UV2" ] || [ $1 = "--option=UV2T" ] ; then
+UV2=`grep -m3 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV2 in
-"uv_0")
+"uv_0")
NUV2="ND"
NUV2T="ND"
;;
@@ -189,7 +196,7 @@ case $UV2 in
NUV2="1"
NUV2T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV2="2"
NUV2T="Baixo"
;;
@@ -243,8 +250,12 @@ case $UV2 in
;;
esac
+
+elif [ $1 = "--option=UV3" ] || [ $1 = "--option=UV3T" ] ; then
+UV3=`grep -m4 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV3 in
-"uv_0")
+"uv_0")
NUV3="ND"
NUV3T="ND"
;;
@@ -264,7 +275,7 @@ case $UV3 in
NUV3="1"
NUV3T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV3="2"
NUV3T="Baixo"
;;
@@ -318,8 +329,13 @@ case $UV3 in
;;
esac
+
+
+elif [ $1 = "--option=UV4" ] || [ $1 = "--option=UV4T" ] ; then
+UV4=`grep -m5 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV4 in
-"uv_0")
+"uv_0")
NUV4="ND"
NUV4T="ND"
;;
@@ -339,7 +355,7 @@ case $UV4 in
NUV4="1"
NUV4T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV4="2"
NUV4T="Baixo"
;;
@@ -394,8 +410,12 @@ case $UV4 in
esac
+
+elif [ $1 = "--option=UV5" ] || [ $1 = "--option=UV5T" ] ; then
+UV5=`grep -m6 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV5 in
-"uv_0")
+"uv_0")
NUV5="ND"
NUV5T="ND"
;;
@@ -415,7 +435,7 @@ case $UV5 in
NUV5="1"
NUV5T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV5="2"
NUV5T="Baixo"
;;
@@ -469,8 +489,12 @@ case $UV5 in
;;
esac
+
+elif [ $1 = "--option=UV6" ] || [ $1 = "--option=UV6T" ] ; then
+UV6=`grep -m7 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV6 in
-"uv_0")
+"uv_0")
NUV6="ND"
NUV6T="ND"
;;
@@ -490,7 +514,7 @@ case $UV6 in
NUV6="1"
NUV6T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV6="2"
NUV6T="Baixo"
;;
@@ -544,8 +568,12 @@ case $UV6 in
;;
esac
+
+elif [ $1 = "--option=UV7" ] || [ $1 = "--option=UV7T" ] ; then
+UV7=`grep -m8 '<img src="http://img0.cptec.inpe.br/~rgrafico/icones_principais/uv/medio/' ~/.brweather/cache/cache | cut -f14 -d'/' | cut -f1 -d'.' | tail -n1`
+
case $UV7 in
-"uv_0")
+"uv_0")
NUV7="ND"
NUV7T="ND"
;;
@@ -565,7 +593,7 @@ case $UV7 in
NUV7="1"
NUV7T="Baixo"
;;
-"uv_2")
+"uv_2")
NUV7="2"
NUV7T="Baixo"
;;
@@ -619,6 +647,7 @@ case $UV7 in
;;
esac
+fi
case $1 in
"--option=UVN") echo $NUVN
diff --git a/brweather/bin/inpe-4 b/brweather/bin/inpe-4
index 54eaab8..0722ca4 100644
--- a/brweather/bin/inpe-4
+++ b/brweather/bin/inpe-4
@@ -10,6 +10,7 @@ NCN=`grep "javascript:janela('http://tempo.cptec.inpe.br/~rtempo/legenda.shtml'"
NC1=`grep -m1 'title="Clique sobre o ícone para ver a legenda"></a></div>' ~/.brweather/cache/cache | cut -f12 -d'/' | cut -f1 -d'.'`
# Dia
+if [ $OPEN = "0" ] ; then
dia(){
case $NCN in
"ec")
@@ -483,6 +484,7 @@ case `date "+%H"` in
*) echo "" >/dev/null
;;
esac
+fi
# Previsão do tempo as próximas horas
case $NC1 in
@@ -687,7 +689,7 @@ case $NC1 in
C1="$IMAGE $DIRNAME/imagens/imagem$IMAGEM/ppm.png $* }"
;;
*)
- echo "Erro." & echo "$ERROCACHE" > ~/.brweather/log
+ echo "Erro." && echo "$ERROCACHE" > ~/.brweather/log
C1="$IMAGE $DIRNAME/imagens/imagem$IMAGEM/nd.png $* }"
;;
esac
diff --git a/brweather/bin/inpe-6 b/brweather/bin/inpe-6
index 6f9503e..3923052 100644
--- a/brweather/bin/inpe-6
+++ b/brweather/bin/inpe-6
@@ -6,6 +6,7 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+
NC5=`grep -m5 'title="Clique sobre o ícone para ver a legenda"></a></div>' ~/.brweather/cache/cache | cut -f12 -d'/' | cut -f1 -d'.' | tail -n1`
NC6=`grep -m6 'title="Clique sobre o ícone para ver a legenda"></a></div>' ~/.brweather/cache/cache | cut -f12 -d'/' | cut -f1 -d'.' | tail -n1`
NC7=`grep -m7 'title="Clique sobre o ícone para ver a legenda"></a></div>' ~/.brweather/cache/cache | cut -f12 -d'/' | cut -f1 -d'.' | tail -n1`
diff --git a/brweather/bin/moon b/brweather/bin/moon
index 074d9bd..7c9f4fa 100755
--- a/brweather/bin/moon
+++ b/brweather/bin/moon
@@ -29,7 +29,6 @@ DATE=`date "+%d %h"`
LUA=`grep "$DATE" $DIRNAME/doc/luas/$YEAR | cut -f2 -d'#'`
#Imagens
-#Imagens
IMAGE=`echo '${image'`
#Lua 1 (hoje)
diff --git a/brweather/bin/open-1 b/brweather/bin/open-1
index 321d986..b4ddaa8 100644
--- a/brweather/bin/open-1
+++ b/brweather/bin/open-1
@@ -5,12 +5,8 @@
# Acesse o site para maiores instruções:
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+
LU=`cat ~/.brweather/cache/lastupdate`
-#LUSA=$(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/dt\042/){print$(i+1)}}}' ~/.brweather/cache/open1)
-#LUSB=$(date -d "01/01/1970 + $LUSA seconds" "+%H")
-#LON=$(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/lon\042/){print$(i+1)}}}' ~/.brweather/cache/open1 | sed s/}//g)
-#COORD=$(echo "$(echo $LON | cut -f1 -d'.')" / 15 | bc)
-#LUS=$(echo $(date -d "$LUSB + $COORD hours" "+%T"))
ODATE=`date "+%d-%m-%Y"`
DAY0=`date "+%a"`
@@ -22,105 +18,83 @@ AUM=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/humidity\042/){print$(i+1)}}
AWS=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/speed\042/){print$(i+1)}}}')
ACA=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/all\042/){print$(i+1)}}}')
-CITY=$(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/name\042/){print$(i+1)}}}' ~/.brweather/cache/open1 | cut -f2 -d'"')
-PA=$($APA ~/.brweather/cache/open1)
-TN=$(echo $(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/temp\042/){print$(i+1)}}}' ~/.brweather/cache/open1) - 273.15 | bc | sed 's/\./,/')
-UMID=$($AUM ~/.brweather/cache/open1)
-WINDS=$(echo $($AWS ~/.brweather/cache/open1)*1.609344 | bc | sed 's/\./,/')
-CLD=$($ACA ~/.brweather/cache/open1 | sed s/}//g)
-
D1=$(echo grep -m1 $(date +%a) ~/.brweather/cache/open2)
DAY1=$(grep -m1 $(date +%a) ~/.brweather/cache/open2 | cut -f2 -d':')
-LT1=$(echo $($D1 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT1=$(echo $($D1 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA1=$(echo $($D1 | $APA))
-UMID1=$(echo $($D1 | $AUM) | sed s/}//g)
-WINDS1=$(echo $($D1 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD1=$(echo $($D1 | $ACA))
-
D2=$(grep -m1 $(date -d "1 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY2=$(echo $D2 | cut -f2 -d':')
-LT2=$(echo $(echo $D2 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT2=$(echo $(echo $D2 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA2=$(echo $(echo $D2 | $APA))
-UMID2=$(echo $(echo $D2 | $AUM) | sed s/}//g)
-WINDS2=$(echo $(echo $D2 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD2=$(echo $(echo $D2 | $ACA))
-
-
DAY0T=`date +%A | sed -r 's/\b[a-z]{3,}/\u&/g'`
case $DAY1 in
"Seg")
- DAY1T="Segunda"
- DAY2T="Terça"
- DAY3T="Quarta"
- DAY4T="Quinta"
- DAY5T="Sexta"
- DAY6T="Sábado"
- DAY7T="Domingo"
+ DAY1T="Segunda"
+ DAY2T="Terça"
+ DAY3T="Quarta"
+ DAY4T="Quinta"
+ DAY5T="Sexta"
+ DAY6T="Sábado"
+ DAY7T="Domingo"
;;
"Ter")
- DAY1T="Terça"
- DAY2T="Quarta"
- DAY3T="Quinta"
- DAY4T="Sexta"
- DAY5T="Sábado"
- DAY6T="Domingo"
- DAY7T="Segunda"
+ DAY1T="Terça"
+ DAY2T="Quarta"
+ DAY3T="Quinta"
+ DAY4T="Sexta"
+ DAY5T="Sábado"
+ DAY6T="Domingo"
+ DAY7T="Segunda"
;;
"Qua")
- DAY1T="Quarta"
- DAY2T="Quinta"
- DAY3T="Sexta"
- DAY4T="Sábado"
- DAY5T="Domingo"
- DAY6T="Segunda"
- DAY7T="Terça"
+ DAY1T="Quarta"
+ DAY2T="Quinta"
+ DAY3T="Sexta"
+ DAY4T="Sábado"
+ DAY5T="Domingo"
+ DAY6T="Segunda"
+ DAY7T="Terça"
;;
"Qui")
- DAY1T="Quinta"
- DAY2T="Sexta"
- DAY3T="Sábado"
- DAY4T="Domingo"
- DAY5T="Segunda"
- DAY6T="Terça"
- DAY7T="Quarta"
+ DAY1T="Quinta"
+ DAY2T="Sexta"
+ DAY3T="Sábado"
+ DAY4T="Domingo"
+ DAY5T="Segunda"
+ DAY6T="Terça"
+ DAY7T="Quarta"
;;
"Sex")
- DAY1T="Sexta"
- DAY2T="Sábado"
- DAY3T="Domingo"
- DAY4T="Segunda"
- DAY5T="Terça"
- DAY6T="Quarta"
- DAY7T="Quinta"
+ DAY1T="Sexta"
+ DAY2T="Sábado"
+ DAY3T="Domingo"
+ DAY4T="Segunda"
+ DAY5T="Terça"
+ DAY6T="Quarta"
+ DAY7T="Quinta"
;;
"Sáb")
- DAY1T="Sábado"
- DAY2T="Domingo"
- DAY3T="Segunda"
- DAY4T="Terça"
- DAY5T="Quarta"
- DAY6T="Quinta"
- DAY7T="Sexta"
+ DAY1T="Sábado"
+ DAY2T="Domingo"
+ DAY3T="Segunda"
+ DAY4T="Terça"
+ DAY5T="Quarta"
+ DAY6T="Quinta"
+ DAY7T="Sexta"
;;
"Dom")
- DAY1T="Domingo"
- DAY2T="Segunda"
- DAY3T="Terça"
- DAY4T="Quarta"
- DAY5T="Quinta"
- DAY6T="Sexta"
- DAY7T="Sábado"
+ DAY1T="Domingo"
+ DAY2T="Segunda"
+ DAY3T="Terça"
+ DAY4T="Quarta"
+ DAY5T="Quinta"
+ DAY6T="Sexta"
+ DAY7T="Sábado"
;;
esac
case $1 in
-"--option=city") echo $CITY
+"--option=city") echo $(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/name\042/){print$(i+1)}}}' ~/.brweather/cache/open1 | cut -f2 -d'"')
;;
"--option=date") echo $ODATE
;;
@@ -132,45 +106,45 @@ case $1 in
#;;
# "--option=LUS") echo $LUS
;;
-"--option=TN") printf "%.0f\n" $TN
+"--option=TN") printf "%.0f\n" $(echo $(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/temp\042/){print$(i+1)}}}' ~/.brweather/cache/open1) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=umid") echo $UMID
+"--option=umid") echo $($AUM ~/.brweather/cache/open1 | sed 's/}//g')
;;
-"--option=PA") echo $PA
+"--option=PA") echo $($APA ~/.brweather/cache/open1 | sed 's/}//g')
;;
-"--option=winds") printf "%.0f\n" $WINDS
+"--option=winds") printf "%.0f\n" $(echo $($AWS ~/.brweather/cache/open1)*1.609344 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=wind") printf "%.0f\n" $WINDS
+"--option=wind") printf "%.0f\n" $(echo $($AWS ~/.brweather/cache/open1)*1.609344 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=CLD") echo $CLD
+"--option=CLD") echo $($ACA ~/.brweather/cache/open1 | sed 's/}//g')
;;
"--option=Day1") echo $DAY1
;;
"--option=Day1T") echo $DAY1T
;;
-"--option=LT1") printf "%.0f\n" $LT1
+"--option=LT1") printf "%.0f\n" $(echo $($D1 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT1") printf "%.0f\n" $HT1
+"--option=HT1") printf "%.0f\n" $(echo $($D1 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA1") echo $PA1
+"--option=PA1") echo $(echo $($D1 | $APA))
;;
-"--option=umid1") echo $UMID1
+"--option=umid1") echo $(echo $($D1 | $AUM) | sed 's/}//g')
;;
-"--option=CLD1") echo $CLD1
+"--option=CLD1") echo $(echo $($D1 | $ACA) | sed 's/}//g')
;;
"--option=Day2") echo $DAY2
;;
"--option=Day2T") echo $DAY2T
;;
-"--option=LT2") printf "%.0f\n" $LT2
+"--option=LT2") printf "%.0f\n" $(echo $(echo $D2 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT2") printf "%.0f\n" $HT2
+"--option=HT2") printf "%.0f\n" $(echo $(echo $D2 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA2") echo $PA2
+"--option=PA2") echo $(echo $(echo $D2 | $APA) | sed 's/}//g')
;;
-"--option=umid2") echo $UMID2
+"--option=umid2") echo $(echo $(echo $D2 | $AUM) | sed 's/}//g')
;;
-"--option=CLD2") echo $CLD2
+"--option=CLD2") echo $(echo $(echo $D2 | $ACA))
;;
"--option=Day3T") echo $DAY3T
;;
diff --git a/brweather/bin/open-2 b/brweather/bin/open-2
index 661b5a0..b395c29 100755
--- a/brweather/bin/open-2
+++ b/brweather/bin/open-2
@@ -13,116 +13,81 @@ AUM=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/humidity\042/){print$(i+1)}}
AWS=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/speed\042/){print$(i+1)}}}')
ACA=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/all\042/){print$(i+1)}}}')
-
-
D3=$(grep -m1 $(date -d "2 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY3=$(echo $D3 | cut -f2 -d':')
-LT3=$(echo $(echo $D3 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT3=$(echo $(echo $D3 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA3=$(echo $(echo $D3 | $APA))
-UMID3=$(echo $(echo $D3 | $AUM) | sed s/}//g)
-WINDS3=$(echo $(echo $D3 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD3=$(echo $(echo $D3 | $ACA))
D4=$(grep -m1 $(date -d "3 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY4=$(echo $D4 | cut -f2 -d':')
-LT4=$(echo $(echo $D4 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT4=$(echo $(echo $D4 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA4=$(echo $(echo $D4 | $APA))
-UMID4=$(echo $(echo $D4 | $AUM) | sed s/}//g)
-WINDS4=$(echo $(echo $D4 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD4=$(echo $(echo $D4 | $ACA))
D5=$(grep -m1 $(date -d "4 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY5=$(echo $D5 | cut -f2 -d':')
-LT5=$(echo $(echo $D5 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT5=$(echo $(echo $D5 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA5=$(echo $(echo $D5 | $APA))
-UMID5=$(echo $(echo $D5 | $AUM) | sed s/}//g)
-WINDS5=$(echo $(echo $D5 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD5=$(echo $(echo $D5 | $ACA))
D6=$(grep -m1 $(date -d "5 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY6=$(echo $D6 | cut -f2 -d':')
-LT6=$(echo $(echo $D6 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT6=$(echo $(echo $D6 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA6=$(echo $(echo $D6 | $APA))
-UMID6=$(echo $(echo $D6 | $AUM) | sed s/}//g)
-WINDS6=$(echo $(echo $D6 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD6=$(echo $(echo $D6 | $ACA))
D7=$(grep -m5 $(date -d "6 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
DAY7=$(echo $D7 | cut -f2 -d':')
-LT7=$(echo $(echo $D7 | $ALT) - 273.15 | bc | sed 's/\./,/')
-HT7=$(echo $(echo $D7 | $AHT) - 273.15 | bc | sed 's/\./,/')
-PA7=$(echo $(echo $D7 | $APA))
-UMID7=$(echo $(echo $D7 | $AUM) | sed s/}//g)
-WINDS7=$(echo $(echo $D7 | $AWS)*1.609344 | bc | sed 's/\./,/')
-CLD7=$(echo $(echo $D7 | $ACA))
-
-
-
case $1 in
"--option=Day3") echo $DAY3
;;
-"--option=LT3") printf "%.0f\n" $LT3
+"--option=LT3") printf "%.0f\n" $(echo $(echo $D3 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT3") printf "%.0f\n" $HT3
+"--option=HT3") printf "%.0f\n" $(echo $(echo $D3 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA3") echo $PA3
+"--option=PA3") echo $(echo $(echo $D3 | $APA) | sed 's/}//g')
;;
-"--option=umid3") echo $UMID3
+"--option=umid3") echo $(echo $(echo $D3 | $AUM) | sed 's/}//g')
;;
-"--option=CLD3") echo $CLD3
+"--option=CLD3") echo $(echo $(echo $D3 | $ACA) | sed 's/}//g')
;;
"--option=Day4") echo $DAY4
;;
-"--option=LT4") printf "%.0f\n" $LT4
+"--option=LT4") printf "%.0f\n" $(echo $(echo $D4 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT4") printf "%.0f\n" $HT4
+"--option=HT4") printf "%.0f\n" $(echo $(echo $D4 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA4") echo $PA4
+"--option=PA4") echo $(echo $(echo $D4 | $APA) | sed 's/}//g')
;;
-"--option=umid4") echo $UMID4
+"--option=umid4") echo $(echo $(echo $D4 | $AUM) | sed 's/}//g')
;;
-"--option=CLD4") echo $CLD4
+"--option=CLD4") echo $(echo $(echo $D4 | $ACA))
;;
"--option=Day5") echo $DAY5
;;
-"--option=LT5") printf "%.0f\n" $LT5
+"--option=LT5") printf "%.0f\n" $(echo $(echo $D5 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT5") printf "%.0f\n" $HT5
+"--option=HT5") printf "%.0f\n" $(echo $(echo $D5 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA5") echo $PA5
+"--option=PA5") echo $(echo $(echo $D5 | $APA) | sed 's/}//g')
;;
-"--option=umid5") echo $UMID5
+"--option=umid5") echo $(echo $(echo $D5 | $AUM) | sed 's/}//g')
;;
-"--option=CLD5") echo $CLD5
+"--option=CLD5") echo $(echo $(echo $D5 | $ACA) | sed 's/}//g')
;;
"--option=Day6") echo $DAY6
;;
-"--option=LT6") printf "%.0f\n" $LT6
+"--option=LT6") printf "%.0f\n" $(echo $(echo $D6 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT6") printf "%.0f\n" $HT6
+"--option=HT6") printf "%.0f\n" $(echo $(echo $D6 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA6") echo $PA6
+"--option=PA6") echo $(echo $(echo $D6 | $APA) | sed 's/}//g')
;;
-"--option=umid6") echo $UMID6
+"--option=umid6") echo $(echo $(echo $D6 | $AUM) | sed 's/}//g')
;;
-"--option=CLD6") echo $CLD6
+"--option=CLD6") echo $(echo $(echo $D6 | $ACA) | sed 's/}//g')
;;
"--option=Day7") echo $DAY7
;;
-"--option=LT7") printf "%.0f\n" $LT7
+"--option=LT7") printf "%.0f\n" $(echo $(echo $D7 | $ALT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=HT7") printf "%.0f\n" $HT7
+"--option=HT7") printf "%.0f\n" $(echo $(echo $D7 | $AHT) - 273.15 | bc | sed 's/\./,/ ; s/}//g')
;;
-"--option=PA7") echo $PA7
+"--option=PA7") echo $(echo $(echo $D7 | $APA) | sed 's/}//g')
;;
-"--option=umid7") echo $UMID7
+"--option=umid7") echo $(echo $(echo $D7 | $AUM) | sed 's/}//g')
;;
-"--option=CLD7") echo $CLD7
+"--option=CLD7") echo $(echo $(echo $D7 | $ACA) | sed 's/}//g')
;;
"--option"*) echo "Opção inválida.
Experimente --help para mais informações."
diff --git a/brweather/bin/open-3 b/brweather/bin/open-3
index 2aa698e..abb9924 100644
--- a/brweather/bin/open-3
+++ b/brweather/bin/open-3
@@ -6,6 +6,7 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+
AWE=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/id\042/){print$(i+1)}}}')
WID=$(awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/weather\042/){print$(i+2)}}}' ~/.brweather/cache/open1)
diff --git a/brweather/bin/open-4 b/brweather/bin/open-4
index 8e89715..b308687 100644
--- a/brweather/bin/open-4
+++ b/brweather/bin/open-4
@@ -6,6 +6,7 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+
AWE=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/id\042/){print$(i+1)}}}')
D2=$(grep -m1 $(date -d "1 day" "+%a") ~/.brweather/cache/open2 | tail -n1)
diff --git a/brweather/bin/open-5 b/brweather/bin/open-5
index dce32c0..5726add 100644
--- a/brweather/bin/open-5
+++ b/brweather/bin/open-5
@@ -6,6 +6,7 @@
# http://brweatherproject.blogspot.com/
# Distribuído sob licença GPLv3
+
AWE=$(echo awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/id\042/){print$(i+1)}}}')
D5=$(grep -m1 $(date -d "4 day" "+%a") ~/.brweather/cache/open2 | tail -n1)