/* readfeed-home.js
* Produciones Viva - Gary. July 2010
* Parse a custom XML weather.
*
*/

source = "http://xoap.weather.com/weather/local/";
prod = "xoap";
code = "MXJO0047";
cc = "*";
cunit = "m";
dayf = "1";
par = "1005217190";
key = "2e4490982af206e0";
query =  source . code . "?link=" . prod . "&cc=" . cc . "&dayf=" . dayf . "&unit=" . cunit . "&par=" . par . "&key=" . key;

$(document).ready(function(){
	$.ajax({
		type: "GET",
		url: "http://xoap.weather.com/weather/local/MXJO0047?link=xoap&cc=*&dayf=1&unit=m&par=1005217190&key=2e4490982af206e0",
		dataType: "xml",
		success: function(xml) {
			$(xml).find('property').each(function() {
				var tmp = $(this).find('tmp').text();
				var icon = $(this).find('icon').text();
				var t = $(this).find('t').text();
				var obst = $(this).find('obst').text();
				$('<div class="weather"></div>').html('<div class="w-today">Today</div><div class="w-image" align="center"><img src="/weather/icons/'+icon+'.png"></div><div class="w-tmp">'+tmp+'°C</div><div class="w-foot">'+obst+'</div>').appendTo('#w-box');
			});		
			
		}
	});

});



