blob: ae37b3567bccc4c78e99806e3c8f7a1c67aadfad (
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
#!/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
DVOLATIL=`grep -m1 '<div class="tit">' ~/.brweather/cache/cache | cut -f2 -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") grep '<div class="i">' ~/.brweather/cache/cache | cut -f2 -d'>' | cut -f1 -d'<'
;;
"--option=date") date "+%d-%m-%Y"
;;
"--option=Day0") date "+%a"
;;
"--option=Day0T") date +%A | sed -r 's/\b[a-z]{3,}/\u&/g'
;;
"--option=LU") cat ~/.brweather/cache/lastupdate
;;
"--option=LUS")
if [ $OPEN == "2" ]; then
grep -m1 '<div class="dados">IUV com Nuvem' ~/.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") grep '<div class="c2"> TEMPERATURA ATUAL' ~/.brweather/cache/cache | cut -f5 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
"--option=STE") grep -A1 '<div class="c4"> SENSAÇÃO TÉRMICA' ~/.brweather/cache/cache | tail -n1 | cut -f2 -d'>' | cut -f1 -d'C' | sed 's/º//g'
;;
"--option=umid") grep '<div class="c3"> UMIDADE RELATIVA' ~/.brweather/cache/cache | cut -f5 -d'>' | cut -f1 -d'C' | cut -f1 -d'%'
;;
"--option=PA") grep -m1 '<div class="c6"> PRESSÃO ATMOSFÉRICA ' ~/.brweather/cache/cache | cut -f5 -d'>' | cut -f1 -d'<'
;;
"--option=windd") grep -m1 '<div class="c5"> DIR. E INTENSIDADE<br>DO VENTO' ~/.brweather/cache/cache | cut -f6 -d'>' | cut -f1 -d'<' | sed 's/ //g'
;;
"--option=winds") grep -m1 '<div class="c5"> DIR. E INTENSIDADE<br>DO VENTO' ~/.brweather/cache/cache | cut -f7 -d'>' | cut -f1 -d'<' | sed 's/ //g'
;;
"--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
|