Add files via upload

This commit is contained in:
Quinta
2023-03-18 22:21:53 +01:00
committed by GitHub
commit fd733cd338
100 changed files with 8809 additions and 0 deletions
+115
View File
@@ -0,0 +1,115 @@
#!/bin/bash
#function: test_image
test_image () {
case $1 in
1|01)
echo a
;;
2|02)
echo b
;;
3|03)
echo c
;;
4|04)
echo c
;;
5|05)
echo c
;;
6|06)
echo d
;;
7|07)
echo e
;;
8|08)
echo e
;;
11)
echo 0
;;
12)
echo h
;;
13|14)
echo g
;;
15)
echo l
;;
16|17)
echo k
;;
18|26)
echo i
;;
19)
echo p
;;
20|21|23)
echo o
;;
22)
echo r
;;
24|31)
echo E
;;
25)
echo u
;;
29)
echo v
;;
30)
echo 5
;;
32)
echo 6
;;
33)
echo A
;;
34|36|37)
echo B
;;
35|38)
echo C
;;
39|40)
echo G
;;
41|42)
echo K
;;
43|44)
echo O
;;
esac
}
#put your accuweather rss address here
address="http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=EUR|XK|298740|PRISTINA"
killall wget
wget -O ./weather_raw $address
if [[ -s ./weather_raw ]]; then
egrep 'Currently|Forecast<\/title>|_31x31.gif' ./weather_raw > ./weather
sed -i '/AccuWeather\|Currently in/d' ./weather
sed -i -e 's/^[ \t]*//g' -e 's/<title>\|<\/title>\|<description>\|<\/description>//g' ./weather
sed -i -e 's/&lt;img src="/\n/g' ./weather
sed -i '/^$/d' ./weather
sed -i -e 's/_31x31.*$//g' -e 's/^.*\/icons\///g' ./weather
sed -i -e '1s/.$//' -e '3s/.$//' -e '6s/.$//' ./weather
for (( i=2; i<=8; i+=3 ))
do
im=$(sed -n ${i}p ./weather)
sed -i $i"s/^.*$/$(test_image $im)/" ./weather
done
fi
+8
View File
@@ -0,0 +1,8 @@
Currently: Partly Sunny: 25C
c
7/22/2012 Forecast
High: 29 C Low: 13 C Some sun, a t-storm; cooler
k
7/23/2012 Forecast
High: 28 C Low: 14 C Variable clouds with t-storms
k
@@ -0,0 +1,56 @@
<?xml version = "1.0"?>
<rss version="2.0">
<channel>
<title>Pristina, XK - AccuWeather.com Forecast</title>
<link>http://www.accuweather.com/en/xk/pristina/298740/%pagename%/298740</link>
<description>AccuWeather.com Forecast &amp; Current Conditions</description>
<ttl>60</ttl>
<copyright>Copyright 2012, AccuWeather, Inc., All rights reserved. For personal use only.</copyright>
<pubDate>Sun, 22 Jul 2012 09:38:43 GMT</pubDate>
<language>en-us</language>
<image>
<title>Pristina, XK - AccuWeather.com Forecast</title>
<link>/en/xk/pristina/298740/weather-forecast/298740</link>
<description>AccuWeather.com The Best Weather on the Web!</description>
<url>http://vortex.accuweather.com/adc2004/pub/images/logos/adc_logo_187.gif</url>
<width>144</width>
<height>19</height>
</image>
<item>
<title>Currently: Partly Sunny: 25C</title>
<link>http://www.accuweather.com/en/xk/pristina/298740/weather-forecast/298740</link>
<guid isPermaLink="false">http://www.accuweather.com/en/xk/pristina/298740/weather-forecast/298740</guid>
<description>Currently in Pristina, XK: 25 &#176;C and Partly Sunny
&lt;img src="http://vortex.accuweather.com/phoenix2/images/common/icons/03_31x31.gif"&gt;
</description>
<pubDate>Sun, 22 Jul 2012 09:38:43 GMT</pubDate>
</item>
<item>
<title>7/22/2012 Forecast</title>
<link>http://www.accuweather.com/en/xk/pristina/298740/daily-weather-forecast/298740?day=1</link>
<guid isPermaLink="false">http://www.accuweather.com/en/xk/pristina/298740/daily-weather-forecast/298740?day=1</guid>
<description>High: 29 C Low: 13 C Some sun, a t-storm; cooler &lt;img src="http://vortex.accuweather.com/phoenix2/images/common/icons/17_31x31.gif" &gt;</description>
<pubDate>Sun, 22 Jul 2012 09:38:43 GMT</pubDate>
</item>
<item>
<title>7/23/2012 Forecast</title>
<link>http://www.accuweather.com/en/xk/pristina/298740/daily-weather-forecast/298740?day=2</link>
<guid isPermaLink="false">http://www.accuweather.com/en/xk/pristina/298740/daily-weather-forecast/298740?day=2</guid>
<description>High: 28 C Low: 14 C Variable clouds with t-storms &lt;img src="http://vortex.accuweather.com/phoenix2/images/common/icons/16_31x31.gif" &gt;</description>
<pubDate>Sun, 22 Jul 2012 09:38:43 GMT</pubDate>
</item>
<item>
<title>The AccuWeather.com RSS Center</title>
<description>To discover additional weather feeds, visit the AccuWeather.com RSS Center at http://www.accuweather.com/en/downloads</description>
<link>http://www.accuweather.com/en/downloads</link>
<guid isPermaLink="false">http://www.accuweather.com/en/downloads</guid>
<pubDate>Sun, 22 Jul 2012 09:38:43 GMT</pubDate>
</item>
</channel>
</rss>