малость поумнел, но всеж скрипты у меня не заробили... поможет кто парсер http://informer.gismeteo.ru/xml/28573_1.xml - вот этого написать ? :-[ //стыдно читать старые сообщения =\
PHP: <?php defined( '_VALID_MOS' ) or die( 'Прямой доступ к файлам по этому адресу запрещен!' ); global $mosConfig_absolute_path; error_reporting(7); require_once( $mosConfig_absolute_path . '/includes/domit/xml_domit_lite_include.php' ); $cache_time = intval( $params->def( 'cache_time', 0 ) ); $cityid = $params->def( 'cityid', 0 ); $week_days = array("","Вс.","Пн.","Вт.","Ср.","Чт.","Пт.","Сб."); $ru_monthes = array("","янв","фев","мар","апр","мая","июн","июл","авг","сен","окт","ноя","дек"); $sutki = array("ночь","утро","день","вечер"); $winds = array("сев","с-в","вост","ю-в","ю","ю-з","зап","с-з"); $oblaka = array("ясно","малооблачно","облачно","пасмурно","дождь","ливень","снег","снег","гроза","нет данных об осадках","без осадков"); $cache_file = $mosConfig_absolute_path."/modules/mod_gismeteo/file.xml"; $result_file = $mosConfig_absolute_path."/modules/mod_gismeteo/result.txt"; $template_file = $mosConfig_absolute_path."/modules/mod_gismeteo/template.txt"; if( 1 || !file_exists( $result_file ) || ( time() - filemtime($result_file) > $cache_time ) ) { $gis_addr = "http://informer.gismeteo.ru/xml/{$cityid}_1.xml"; if( !$gis_stream = fopen( $gis_addr, "rb" ) ) { echo "Невозможно соединиться с богом погоды"; return; } $gis_file = ''; do { $data = fread($gis_stream, 8192 ); if( strlen( $data ) == 0 ) { break; } $gis_file .= $data; } while( true ); fclose($gis_stream); if( !$cache_stream = fopen($cache_file, "w") ) { echo "Невозможно использовать кэш"; return; } $cache_ok = fwrite($cache_stream, $gis_file); fclose($cache_stream); $xmlfile = $cache_file; $template = file_get_contents( $template_file ); $result = ""; if (file_exists( $xmlfile )) { $xmlDoc =& new DOMIT_Lite_Document(); $xmlDoc->resolveErrors( true ); if ($xmlDoc->loadXML( $xmlfile, false, true )) { $element = &$xmlDoc->documentElement; if ($element->getTagName() == 'MMWEATHER') { if( $report = &$xmlDoc->getElementsByPath( 'REPORT', 1 ) ) { if( $town = $report->getElementsByPath( 'TOWN', 1 ) ) { for( $k=1; $k<5; $k++ ) { $forecast = $town->getElementsByPath( 'FORECAST', $k ) ; $day = $forecast->getAttribute('day'); $month = $ru_monthes[$forecast->getAttribute('month')]; $year = $forecast->getAttribute('year'); $tod = $sutki[$forecast->getAttribute('tod')]; $hour = $forecast->getAttribute('hour'); $temperature = $forecast->getElementsByPath( 'TEMPERATURE', 1 ); $min_temperature = $temperature->getAttribute('min'); $max_temperature = $temperature->getAttribute('max'); $pressure = $forecast->getElementsByPath( 'PRESSURE', 1 ); $min_pressure = $pressure->getAttribute('min'); $max_pressure = $pressure->getAttribute('max'); $wind = $forecast->getElementsByPath( 'WIND', 1 ); $wind_direction = $winds[ $wind->getAttribute('direction') ]; $min_wind = $wind->getAttribute('min'); $max_wind = $wind->getAttribute('max'); $relwet = $forecast->getElementsByPath( 'RELWET', 1 ); $min_relwet = $relwet->getAttribute('min'); $max_relwet = $relwet->getAttribute('max'); $heat = $forecast->getElementsByPath( 'HEAT', 1 ); $min_heat = $heat->getAttribute('min'); $max_heat = $heat->getAttribute('max'); $phenomena = $forecast->getElementsByPath( 'PHENOMENA', 1 ); $cloudiness = $oblaka[$phenomena->getAttribute('cloudiness')]; $precipitation = $oblaka[$phenomena->getAttribute('precipitation')]; eval("\$result .= \"{$template}\";"); } } } } else echo "Некорректный xml-документ"; } else echo "Невозможно открыть xml-документ"; } else echo 'Не найден xml-файл'; if( $cache_time && $result_stream = fopen($result_file, "w") ) { fwrite($result_stream, $result); fclose($result_stream); } echo $result; } else echo file_get_contents( $result_file ); ?> вот модуль от мамбы, я попробывал сам его переделать но не получилось, даже при смене путей файлов и убирание хрени остальной. поправьте плз.