これは一般に3番目または5番目のbashスクリプトであり、awkを初めて使用し、xmlを使用したことは一度もないと言わなければなりません。 したがって、私はこれらすべてを必要なレベルまで学習する必要がありました。これは数時間のグーグルで行われました。 私はこれをすべて言って、明白な(私のためではない)失敗のためにコードをからかわないようにしますが、それを修正/最適化する方法と方法を提案します。 このため、私は非常に感謝します(:
実際、スクリプトを機能させるには、 xmlstarletプログラムが必ず必要です。 レターの送信はmuttを経由しますが、たとえばmailに簡単に置き換えることができます。
コード自体は次のとおりです。
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
クラウン設定では、スクリプトの実行を20:30以降に設定する必要があります。 この時間まで、天気は翌日ではなく、今日と明日が与えられます。
以上です。 誰かが役に立つことを願っています(:。
PS一部のオペレーターは、最初にemail2smsサービスをブロックします。 たとえば、DjuiceまたはKyivstarの購読者に対して有効にするには、空のメッセージを7021に送信する必要があります(無料)。
UPD。 コードの一部(ほとんどすべての変数)がUFOに盗まれたことに気付きました。 修正されているようですが......
UPD2。 いくつかのゲートウェイとのリンク:
smeshok.com/main/useful/mobile/emailtosmsgates/index-00001.shtml
smsprikol.com/email2sms.php?mod=email2sms.php