Что нового

Модуль погоды

  • Автор темы Автор темы 0021
  • Дата начала Дата начала

0021

Посетитель
OLD SkripTers
Регистрация
17 Дек 2019
Сообщения
333
Реакции
2
Может кто встречал данный модуль?
 
Создаеш файл pogoda.php в него вставляешь код<?php$pogoda = file_get_contents(\'http://export.yandex.ru/weather/?city=23848\');preg_match(\'/<weather_type>(.*?)<\\/weather_type>/i\',$pogoda,$type);preg_match(\'/<dampness>(.*?)<\\/dampness>/i',$pogoda,$vlaga);preg_match(\'/<temperature>(.*?)<\\/temperature>/i\',$pogoda,$temp);preg_match(\'/<image2>(.*?)<\\/image2>/i\',$pogoda,$img2);preg_match(\'/<pressure>(.*?)<\\/pressure>/i',$pogoda,$press);$vivod = \"<div style=\\\"float:left;display:inline;margin-top:5px;\\\"><font size = 3><strong>В Нефтеюганске          $temp[1] °</strong></font>          <img align=top src=$img2[1] /></div>          <div style=\\\"display:inline;\\\">          <font size = 2>\";echo $vivod;?>где city=23848-код нужного городаПодключениние: через {include file=\"engine/modules/pogoda.php\"}файл с городами
 
<?php$city = 23848;$handler = new DOMDocument();$handler->load(\'http://export.yandex.ru/weather/?city=\' . $city);$weather = $handler->firstChild->firstChild;while($weather->tagName){ print $weather->tagName . \": \" . $weather->nodeValue . \"<br />\"; $weather = $weather->nextSibling;}?>
 
zloy_admin, Dellok, Спасибо (+)!
 
Верх