Мой сайт
 С миру по нитке - Обзор мировых новостей

\ http://www.wunderground.com/\ Weather Underground RSS Feed\ EN\ \ http://icons.wunderground.com/graphics/smash/wunderTransparent.gif\ http://www.wunderground.com\ Weather Underground \ \ weather\ \ Rome, Italy Current Conditions - 5:45 PM CEST Oct. 21\ http://www.wunderground.com/global/stations/16239.html\ Temperature: 64°F / 18°C | Humidity: 100% | \ Pressure: 29.92in / 1013hPa | Conditions: Mostly Cloudy | \ Wind Direction: South | Wind Speed: 7mph / 11km/h | Updated: 5:45 PM CEST\ \ Fri, 21 Oct 2005 15:45:00 GMT\ \ \ '; // convert string to XML object var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml"); // get a reference to the root-element "rss" var root = xmlobject.getElementsByTagName('rss')[0]; // get reference to "channel" element var channels = root.getElementsByTagName("channel"); // now get all "item" tags in the channel var items = channels[0].getElementsByTagName("item"); // in the "item" we have a description, so get that var descriptions = items[0].getElementsByTagName("description"); // we also get the "pubDate" element in the "item" var date = items[0].getElementsByTagName("pubDate"); // get the actual description as string var desc = descriptions[0].firstChild.nodeValue; // split the string - temperature is element #1 -> 0 var descarray = desc.split("|"); var temperature = descarray[0]; // same for the pubDate var update = date[0].firstChild.nodeValue; var tooltipstring = update + ": " + descarray[3]; // now we have the RSS data we want as strings - do something now :-) alert(temperature); alert(tooltipstring);
Среда, 25.06.2025, 18:51
Приветствую Вас Гость
Главная | Регистрация | Вход
Форма входа
Поиск
Календарь
«  Июнь 2025  »
ПнВтСрЧтПтСбВс
      1
2345678
9101112131415
16171819202122
23242526272829
30
Наш опрос
Оцените мой сайт
Всего ответов: 0
Друзья сайта
  • Официальный блог
  • Сообщество uCoz
  • FAQ по системе
  • Инструкции для uCoz
  • Статистика

    Онлайн всего: 1
    Гостей: 1
    Пользователей: 0

    Copyright MyCorp © 2025