#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0#!/bin/bash
# xmlstarlet- mxl- wheather ( ) { cloud = ` echo $wh | awk '{print $3}' ` prec = ` echo $wh | awk '{print $5}' ` tmin = ` echo $wh | awk '{print $7}' ` tmax = ` echo $wh | awk '{print $9}' ` }
# f_clpr ( ) { if [ [ "$cloud" == "0" ] ] ; then cl = "jasno" elif [ [ "$cloud" == "1" ] ] ; then cl = "per.obl." elif [ [ "$cloud" == "2" ] ] ; then cl = "oblachno" elif [ [ "$cloud" == "3" ] ] ; then cl = "pasmurno" fi
if [ [ "$prec" == "10" ] ] ; then pr = "bez osadkov" elif [ [ "$prec" == "9" ] ] ; then pr = "n\d" elif [ [ "$prec" == "8" ] ] ; then pr = "groza" elif [ [ "$prec" == "6" || "$prec" == "7" ] ] ; then pr = "sneg" elif [ [ "$prec" == "5" ] ] ; then pr = "liven" elif [ [ "$prec" == "4" ] ] ; then pr = "dozhd" fi }
# f_temp ( ) { tc =$ ( ( $tmax / 2 + $tmin / 2 ) ) echo "$tc" }
# xml ( cat <<'EOF' <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:for-each select="MMWEATHER/REPORT/TOWN/FORECAST"> <xsl:value-of select="@hour" /> h <xsl:for-each select="PHENOMENA"> <xsl:value-of select="@cloudiness" /> c <xsl:value-of select="@precipitation" /> p </xsl:for-each> <xsl:for-each select="TEMPERATURE"> <xsl:value-of select="@min" /> tn <xsl:value-of select="@max" /> tx </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> EOF ) > / tmp / informer.xsl
# xml-. wget -q -O / tmp / informer.xml http: // informer.gismeteo.ru / xml / 33526 _1.xml
# , xmlstarlet- / usr / bin / xmlstarlet tr / tmp / informer.xsl / tmp / informer.xml > / tmp / informer.tmp
# sms . ($tc) ($tmin)-($tmax) wh = ` cat / tmp / informer.tmp | grep -A 4 "02 h" ` wheather f_clpr f_temp w02 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "08 h" ` wheather f_clpr f_temp w08 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "14 h" ` wheather f_clpr f_temp w14 = ` echo "$cl" "$pr" t:"$tc" `
wh = ` cat / tmp / informer.tmp | grep -A 4 "20 h" ` wheather f_clpr f_temp w20 = ` echo "$cl" "$pr" t:"$tc" `
# . sms-gate echo "noch':$w02; utro:$w08; den':$w14; vecher:$w20" | mutt -s "" xxxxxxxxxx@sms.kyivstar.net
# rm -f / tmp / informer.xml / tmp / informer.tmp / tmp / informer.xsl
exit 0 0
Source: https://habr.com/ru/post/76867/
All Articles