#!/bin/bash
# Санкт-Петербург
URL1='http://www.accuweather.com/ru/ru/saint-petersburg/295212/weather-forecast/295212'
# Братск
URL2='http://www.accuweather.com/ru/ru/-/288008/weather-forecast/288008'
# Ростов на Дону
#URL='http://www.accuweather.com/ru/ru/rostov-on-don/295146/weather-forecast/295146'
wget -q -O- "$URL1" > /tmp/pogoda
wget -q -O- "$URL2" > /tmp/pogoda1
TEMP=$(cat /tmp/pogoda | grep "large-temp" | tail -n 1 | sed 's/^..................................................................//' | sed 's/.............$//')
GORO=$(cat /tmp/pogoda | grep "current-city" | grep "span" | sed 's/^...................................................................//' | sed 's/.....................$//')
OSAD=$(cat /tmp/pogoda | grep "span class" | grep "cond" | head -n 1 | sed 's/^...........................................................//' | sed 's/........$//')
TEMP1=$(cat /tmp/pogoda1 | grep "large-temp" | tail -n 1 | sed 's/^..................................................................//' | sed 's/.............$//')
GORO1=$(cat /tmp/pogoda1 | grep "current-city" | grep "span" | sed 's/^...................................................................//' | sed 's/.....................$//')
OSAD1=$(cat /tmp/pogoda1 | grep "span class" | grep "cond" | head -n 1 | sed 's/^...........................................................//' | sed 's/........$//')
#echo " $GORO $TEMP $OSAD"
#echo " $GORO1 $TEMP1 $OSAD1"
echo " $GORO $TEMP $OSAD" > /tmp/pogodasp
echo " $GORO1 $TEMP1 $OSAD1" > /tmp/pogodabr
Комментариев нет:
Отправить комментарий