aboutsummaryrefslogtreecommitdiff
path: root/src/bin/inpe-2
blob: e9e9b3893a5b6b738dc3f40984a3d9f53e938715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/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

LT1=`grep -A2 -m1 '<div class="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"
else
LT1="$NLT1"
fi

case $1 in
"--option=LT1") echo $LT1
;;
"--option=HT1") grep -m1 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
"--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") grep -m1 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
"--option=SOLN1") grep -m1 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
"--option=SOLP1") grep -m1 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<'
;;
"--option=LT2") grep -m2 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT2") grep -m2 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m2 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN2") grep -m2 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP2") grep -m2 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=LT3") grep -m3 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT3") grep -m3 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m3 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN3") grep -m3 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP3") grep -m3 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=LT4") grep -m4 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT4") grep -m4 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m4 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN4") grep -m4 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP4") grep -m4 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=LT5") grep -m5 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT5") grep -m5 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m5 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN5") grep -m5 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP5") grep -m5 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=LT6") grep -m6 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT6") grep -m6 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m6 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN6") grep -m6 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP6") grep -m6 '<div class="c6">PÔR DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=LT7") grep -m7 '<div class="c2">TEMP. MÍNIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--option=HT7") grep -m7 '<div class="c3">TEMP. MÁXIMA<br><b>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'C' | sed 's/º//g' | tail -n1
;;
"--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") grep -m7 '<div class="dd1"> 15h00<br>' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLN7") grep -m7 '<div class="c5">NASCER DO SOL' ~/.brweather/cache/cache | cut -f4 -d'>' | cut -f1 -d'<' | tail -n1
;;
"--option=SOLP7") grep -m7 '<div class="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."
;;
esac
exit 0