Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

getmeteo no

By: a guest on Jan 13th, 2012  |  syntax: None  |  size: 0.71 KB  |  views: 67  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     var urlWeather = "http://www.google.fr/ig/api?weather=Quissac,FR";
  2.     var icoWeather = 's105001';
  3.  
  4.     function getmeteo() {
  5.        CF.request(urlWeather, function(status, headers, body) {
  6.           var parser=new DOMParser();
  7.           var xmlDoc = parser.parseFromString(body, "text/xml");
  8.           var temp = xmlDoc.getElementsByTagName("temp_c");
  9.           var t = temp[0].getAttribute("data");
  10.           //CF.log("t = " + t);
  11.           CF.setJoin("s105002", t + "°C");      
  12.           var icon = xmlDoc.getElementsByTagName("icon");
  13.           var ic = icon[0].getAttribute("data");
  14.           //CF.log("ic = " + ic);
  15.           CF.setJoin(icoWeather, "http://www.google.fr" + ic);
  16.        });
  17.     }
clone this paste RAW Paste Data