I encountered a small parsing issue in Teo's weather script, I'm trying to fix it, but I'm not seeing what's causing the problem straight off, I'm no SED or GREP expert unfortunately.
parsing issue.png
As shown above, only the weather information after the semicolon is being pulled in to Conky for Today and Tonight.
The first_days_raw file has the entire line...
Code:
</ul>
</div>
<p>A little snow at times this morning; otherwise, breezy and much colder with clouds breaking</p>
</div>
<!-- /.desc -->
and
Code:
</ul>
</div>
<p>Clear to partly cloudy and bitterly cold; extreme cold can be dangerous for outdoor activities late</p>
</div>
<!-- /.desc -->
but only the following portions of those lines are being pulled into the first_days file and read by Conky...
Code:
otherwise, breezy and much colder with clouds breaking
E
1
-13
5%
extreme cold can be dangerous for outdoor activities late
I expect if the issue can be resolved, it would be within the following portion of code in the 1b2 file...
Code:
#First 5days - first_days file if [[ -s $HOME/.conky/1b2_accuweather_conkyweather_font/first_days_raw ]]; then
sed -i '/<div class="column-1 clearfix">/,/<div id=\"feature-history\">/!d' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days_raw
egrep -i '>Today<|<p>[a-z]|>Mon<\/a>|>Tue<\/a>|>Wed<\/a>|>Thu<\/a>|>Fri<\/a>|>Sat<\/a>|>Sun<\/a>|icon i-|"cond"|"temp"|realfeel">RealFeel|realfeel">Precipitation' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days_raw > $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i -e 's/^[ \t]*//g' -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' -e 's/>Lo</\n/g' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i -e 's/ "><\/div>//g' -e 's/"><\/div>//g' -e 's/^.*"temp">//g' -e 's/<span>°.*$//g' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i -e 's/<p>//g' -e 's/<\/p>//g' -e 's/^.*"#">//g' -e 's/\/span> //g' -e 's/^.*>Precipitation //g' -e 's/^.*; //g' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i -e 's/&#.*$//g' -e 's/<.*$//g' -e 's/ i-alarm.*$//g' -e 's/\r//g' -e 's/ *$//g' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i -e 's/Today/TODAY/' -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
sed -i 's/-s\|-l.*$//g' $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
time=$(sed -n 1p $HOME/.conky/1b2_accuweather_conkyweather_font/curr_cond)
if [[ $time == Tonight || $time == Overnight || $time == "Early AM" ]]; then
sed -i 2a- $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
fi
L1=$(sed -n 1p $HOME/.conky/1b2_accuweather_conkyweather_font/first_days)
if [[ $L1 == TODAY ]]; then
sed -i 1d $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
fi
for (( i=6; i<=21; i+=5 ))
do
image_raw=$(sed -n "${i}"p $HOME/.conky/1b2_accuweather_conkyweather_font/first_days)
sed -i ${i}s/$image_raw/$(test_image $image_raw)/ $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
done
image_raw=$(sed -n 25p $HOME/.conky/1b2_accuweather_conkyweather_font/first_days)
sed -i 25s/$image_raw/$(test_image $image_raw)/ $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
image_raw=$(sed -n 30p $HOME/.conky/1b2_accuweather_conkyweather_font/first_days)
sed -i 30s/$image_raw/$(test_image $image_raw)/ $HOME/.conky/1b2_accuweather_conkyweather_font/first_days
fi
but I'm not seeing a solution, so I am going to defer to the experts here.
Bookmarks