Comunidad de diseño web y desarrollo en internet online

Como actualizar datos - refresh...necesito ayuda!!

Citar            
MensajeEscrito el 22 Jun 2009 01:51 pm
Hola, bueno el tema es el siguiente. Estoy haciendo un visualizador rss para el clima, que toma los datos del rss de yahoo.
Anda todo bien, pero no se como hacer para actualizar los datos. Digamos, cada 30 min se debería conectar a la url correspondiente a la ciudad seleccionada y tomar los datos del rss nuevamente. Así mismo tengo que darle la posibilidad de elegir entre 5 ciudades predeterminadas, pero no se como hacer para que tome los datos de la nueva ciudad una vez seleccionada.
Les dejo el código. A ver si me ayudan :)

// load the XML from the RSS feed
function loadRSSWeather(){

// The following parsing algorithm is made specifically for the Yahoo Weather RSS feed.
// The parser looks for the exact path to the weather data we are looking for:
// rss.channel.item.{yweather:condition, yweather:forecast}

xmlData = this.firstChild.firstChild.childNodes;
todaysWeather = new Weather();

for(var i=0; i<xmlData.length; i++){
if(xmlData[i].nodeName=="item"){
itemData = xmlData[i].childNodes;
for(var j=0; j<itemData.length; j++){
if(itemData[j].nodeName.indexOf("weather")>0){
if(itemData[j].nodeName.indexOf("condition")>0){
// this is the current conditions
// attach weatherDay from library and pass all tag attributes from data source
obj = _root.attachMovie("weatherDay","todaysWeather",_root.getNextHighestDepth(),itemData[j].attributes);
obj._x = 0;
obj._y = 0;
weatherDays.push(obj);
/*_root.obj.rollCiudad.listaCiudades.ciudad1.onRelease = function(){
_root.obj.rollCiudad.gotoAndStop(26);
feedURL="http://xml.weather.yahoo.com/forecastrss?p=ARCA5147&u=c";*/
//cargaTotal(feedURL);
}else if(itemData[j].nodeName.indexOf("forecast")>1){
// this is part of the forecast
// attach weatherDay from library and pass all tag attributes from data source forecastWeather
// Datos de mañana
obj = _root.attachMovie("weatherDay","forecast",_root.getNextHighestDepth(),itemData[j].attributes);
obj._visible = 0;
weatherDays.push(obj);
j++;
// Datos de pasado mañana
obj = _root.attachMovie("weatherDay","forecast2",_root.getNextHighestDepth(),itemData[j].attributes);
obj._visible = 0;
weatherDays.push(obj);

}
}
}
}
}
dispatchEvent({type:"xmlInit", target:this});
}
}

Por claudiocisneros

2 de clabLevel



 

safari
Citar            
MensajeEscrito el 22 Jun 2009 01:53 pm
Por las dudas aclaro, este no es el código completo, es solo la parte donde hace attach de los movie y les pasa los datos del rss. Si necesitan ver el código completo me avisan

Por claudiocisneros

2 de clabLevel



 

safari
Citar            
MensajeEscrito el 23 Jun 2009 12:49 pm
Por favor?...algún dato?, algo? :(

Por claudiocisneros

2 de clabLevel



 

safari

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.