SMSによる気象ギスメテオ(bash)

Habréで一度、ギスメテオで必要な都市の構文解析を行うスクリプトをレイアウトし、email2smsを使用して電話に送信しました。 それには2つの欠点がありました:FreeBSDで書かれた(Linuxで移植するのは非常に簡単でしたが)、そして最も重要なことには、降水量を示さなかった(o_O)。 そのため、情報提供者向けのxmlから情報を取得し、便利な形式に変換してSMSで送信するように、スクリプトを変更することにしました。 それから彼は考えを変えて、ゼロから書きました。



これは一般に3番目または5番目のbashスクリプトであり、awkを初めて使用し、xmlを使用したことは一度もないと言わなければなりません。 したがって、私はこれらすべてを必要なレベルまで学習する必要がありました。これは数時間のグーグルで行われました。 私はこれをすべて言って、明白な(私のためではない)失敗のためにコードをからかわないようにしますが、それを修正/最適化する方法と方法を提案します。 このため、私は非常に感謝します(:

実際、スクリプトを機能させるには、 xmlstarletプログラムが必ず必要です。 レターの送信はmuttを経由しますが、たとえばmailに簡単に置き換えることができます。

コード自体は次のとおりです。

  1. #!/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




  2. #!/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




  3. #!/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




  4. #!/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




  5. #!/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




  6. #!/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




  7. #!/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




  8. #!/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




  9. #!/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




  10. #!/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




  11. #!/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




  12. #!/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




  13. #!/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




  14. #!/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




  15. #!/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




  16. #!/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




  17. #!/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




  18. #!/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




  19. #!/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. #!/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




  21. #!/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




  22. #!/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




  23. #!/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




  24. #!/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




  25. #!/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




  26. #!/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




  27. #!/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




  28. #!/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




  29. #!/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




  30. #!/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




  31. #!/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




  32. #!/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




  33. #!/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




  34. #!/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




  35. #!/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




  36. #!/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




  37. #!/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




  38. #!/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




  39. #!/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




  40. #!/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




  41. #!/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




  42. #!/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




  43. #!/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




  44. #!/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




  45. #!/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




  46. #!/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




  47. #!/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




  48. #!/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




  49. #!/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




  50. #!/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




  51. #!/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




  52. #!/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




  53. #!/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




  54. #!/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




  55. #!/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




  56. #!/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




  57. #!/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




  58. #!/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




  59. #!/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




  60. #!/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




  61. #!/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




  62. #!/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




  63. #!/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




  64. #!/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




  65. #!/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




  66. #!/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




  67. #!/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




  68. #!/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




  69. #!/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




  70. #!/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




  71. #!/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




  72. #!/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




  73. #!/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




  74. #!/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




  75. #!/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




  76. #!/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




  77. #!/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




  78. #!/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




  79. #!/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




  80. #!/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




  81. #!/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




  82. #!/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




  83. #!/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




  84. #!/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




  85. #!/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




  86. #!/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




  87. #!/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




  88. #!/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




  89. #!/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




  90. #!/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




  91. #!/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




  92. #!/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




  93. #!/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




  94. #!/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




  95. #!/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




  96. #!/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




  97. #!/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




  98. #!/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




  99. #!/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




  100. #!/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




  101. #!/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




  102. #!/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




  103. #!/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




  104. #!/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




  105. #!/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




  106. #!/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



All Articles