1. rasputin007's Avatar
    I have been using WorldWeatherOnline for month now and I find it better then Yahoo Weather.
    It also works all over the globe and is free to use. Said that you need to register for free to get an API key.
    Without that API key you will not be able to get any data.
    On their website is also a very good documentation and explanation what what is and what what does.
    The real advantage is that you only need the latitude and longitude to get the weather and the forecast for the next 4 days, unlike Yahoo where you need 3 urls to get the same info.
    This is the request javascript.
    function getWeather(){
    	jQuery.get('/var/mobile/Documents/myLocation.txt', function(appdata) {
    			var myvar = appdata;
    			var substr = appdata.split('\n');
    			var templati=(substr[0]).split('=');
    			var templongi=(substr[1]).split('=');
    			var lati = $.trim(templati[1]);
    			var longi = $.trim(templongi[1]);
    	var wwourl=("http://api.worldweatheronline.com/free/v1/weather.ashx?q="+lati+","+longi+"&format=json&num_of_days=5&key="+MyKey);
    $.getJSON(wwourl, function(result) 
    		cloudcover = result.data.current_condition[0].cloudcover;
    		update = result.data.current_condition[0].observation_time;
    		humidity = result.data.current_condition[0].humidity;
    		precipiMM = result.data.current_condition[0].precipMM;  //rain fall in millimeters
    		var inch1 =(precipiMM*0.03937);
    		var inch2 = (inch1*100);
    		var inch3 = Math.round(inch2);
    		var precipiIN = (inch3*0.01);  //rain fall in inches
    		pressure = result.data.current_condition[0].pressure;
    		tempF = result.data.current_condition[0].temp_F;
    		tempC = result.data.current_condition[0].temp_C;
    		visibM = result.data.current_condition[0].visibility; //visibility in kilometers
    		var mile1 =(visibM*0.621371192);
    		var mile2 = (mile1*10);
    		var mile3 = Math.round(mile2);
    		var visibI = (mile3*0.1);  //visibility in miles
    		code = result.data.current_condition[0].weatherCode;
    		weatherdesc = result.data.current_condition[0].weatherDesc[0].value;
    		winddir = result.data.current_condition[0].winddir16Point;
    		winddegree = result.data.current_condition[0].winddirDegree;
    		windkm = result.data.current_condition[0].windspeedKmph;
    		windmiles = result.data.current_condition[0].windspeedMiles;
    		day1MaxC = result.data.weather[0].tempMaxC;
    		day1MinC = result.data.weather[0].tempMinC;
    		day1MaxF = result.data.weather[0].tempMaxF;
    		day1MinF = result.data.weather[0].tempMinF;
    		day2 = result.data.weather[1].date;
    		day2year = day2.split('-')[0];
    		day2month = day2.split('-')[1];
    		day2day = day2.split('-')[2];
    		date2= (day2day+"/" + day2month+"/" + day2year);
    		day2precipiMM = result.data.weather[1].precipMM;
    		var day2inch1 =(day2precipiMM*0.03937);
    		var day2inch2 = (day2inch1*100);
    		var day2inch3 = Math.round(day2inch2);
    		var day2precipiIN = (day2inch3*0.01);
    		day2MaxC = result.data.weather[1].tempMaxC;
    		day2MinC = result.data.weather[1].tempMinC;
    		day2MaxF = result.data.weather[1].tempMaxF;
    		day2MinF = result.data.weather[1].tempMinF;
    		day2code = result.data.weather[1].weatherCode;
    		day2desc = result.data.weather[1].weatherDesc[0].value;
    		day2winddir = result.data.weather[1].winddir16Point;
    		day2winddegree = result.data.weather[1].winddirDegree;
    		day2windkm = result.data.weather[1].windspeedKmph;
    		day2windmiles = result.data.weather[1].windspeedMiles;
    		day3 = result.data.weather[2].date;
    		day3year = day3.split('-')[0];
    		day3month = day3.split('-')[1];
    		day3day = day3.split('-')[2];
    		date3= (day3day+"/" + day3month+"/" + day3year);
    		day3precipiMM = result.data.weather[2].precipMM;
    		var day3inch1 =(day3precipiMM*0.03937);
    		var day3inch2 = (day3inch1*100);
    		var day3inch3 = Math.round(day3inch2);
    		var day3precipiIN = (day3inch3*0.01);
    		day3MaxC = result.data.weather[2].tempMaxC;
    		day3MinC = result.data.weather[2].tempMinC;
    		day3MaxF = result.data.weather[2].tempMaxF;
    		day3MinF = result.data.weather[2].tempMinF;
    		day3code = result.data.weather[2].weatherCode;
    		day3desc = result.data.weather[2].weatherDesc[0].value;
    		day3winddir = result.data.weather[2].winddir16Point;
    		day3winddegree = result.data.weather[2].winddirDegree;
    		day3windkm = result.data.weather[2].windspeedKmph;
    		day3windmiles = result.data.weather[2].windspeedMiles;
    		day4 = result.data.weather[3].date;
    		day4year = day4.split('-')[0];
    		day4month = day4.split('-')[1];
    		day4day = day4.split('-')[2];
    		date4= (day4day+"/" + day4month+"/" + day4year);
    		day4precipiMM = result.data.weather[3].precipMM;
    		var day4inch1 =(day4precipiMM*0.03937);
    		var day4inch2 = (day4inch1*100);
    		var day4inch3 = Math.round(day4inch2);
    		var day4precipiIN = (day4inch3*0.01);
    		day4MaxC = result.data.weather[3].tempMaxC;
    		day4MinC = result.data.weather[3].tempMinC;
    		day4MaxF = result.data.weather[3].tempMaxF;
    		day4MinF = result.data.weather[3].tempMinF;
    		day4code = result.data.weather[3].weatherCode;
    		day4desc = result.data.weather[3].weatherDesc[0].value;
    		day4winddir = result.data.weather[3].winddir16Point;
    		day4winddegree = result.data.weather[3].winddirDegree;
    		day4windkm = result.data.weather[3].windspeedKmph;
    		day4windmiles = result.data.weather[3].windspeedMiles;
    		day5 = result.data.weather[4].date;
    		day5year = day5.split('-')[0];
    		day5month = day5.split('-')[1];
    		day5day = day5.split('-')[2];
    		date5= (day5day+"/" + day5month+"/" + day5year);
    		day5precipiMM = result.data.weather[4].precipMM;
    		var day5inch1 =(day5precipiMM*0.03937);
    		var day5inch2 = (day5inch1*100);
    		var day5inch3 = Math.round(day5inch2);
    		var day5precipiIN = (day5inch3*0.01);
    		day5MaxC = result.data.weather[4].tempMaxC;
    		day5MinC = result.data.weather[4].tempMinC;
    		day5MaxF = result.data.weather[4].tempMaxF;
    		day5MinF = result.data.weather[4].tempMinF;
    		day5code = result.data.weather[4].weatherCode;
    		day5desc = result.data.weather[4].weatherDesc[0].value;
    		day5winddir = result.data.weather[4].winddir16Point;
    		day5winddegree = result.data.weather[4].winddirDegree;
    		day5windkm = result.data.weather[4].windspeedKmph;
    		day5windmiles = result.data.weather[4].windspeedMiles;
    		$("#desc").text(ConditionNames(code)); //ConditionNames is the translate function in WWO-codes.js
    		$("#humidity").text(humidity+" %");
    		if (MyUnit == "Metric"){
    		$("#rain").text(precipiMM+" mm");
    		if (MyUnit == "Imperial"){
    		$("#rain").text(precipiIN+" in");
    		if (TwentyFourHourClock == "true"){
    		if (TwentyFourHourClock == "false"){
    		if (MyUnit == "Metric"){
    		$("#visible").text(visibM+" km");
    		if (MyUnit == "Imperial"){
    		$("#visible").text(visibI+" miles");
    		$("#latlong").text(textLat + "  " + textLong);
    		if (MyUnit == "Metric"){
    		$("#windspeed").text(windkm+" km");
    		if (MyUnit == "Imperial"){
    		$("#windspeed").text(windmiles+" miles");
    		if (tempUnit == "Celsius") {
    		if (tempUnit == "Fahrenheit") {
    		if (MyUnit == "Metric"){
    		$("#Day2rain").text(day2precipiMM+" mm");
    		if (MyUnit == "Imperial"){
    		$("#Day2rain").text(day2precipiIN+" in");
    		if (tempUnit== "Celsius"){
    			$("#Day2temp").text(day2MaxC+"\u00B0C / "+day2MinC+"\u00B0C");
    		if (tempUnit== "Fahrenheit"){
    			$("#Day2temp").text(day2MaxF+"\u00B0F / "+day2MinF+"\u00B0F");
    //		$("#Day2winddegree").text(day2winddegree);
    		if (MyUnit == "Metric"){
    		$("#Day2windspeed").text(day2windkm+" km");
    		if (MyUnit == "Imperial"){
    		$("#Day2windspeed").text(day2windmiles+" miles");
    		if (MyUnit == "Metric"){
    		$("#Day3rain").text(day3precipiMM+" mm");
    		if (MyUnit == "Imperial"){
    		$("#Day3rain").text(day3precipiIN+" in");
    		if (tempUnit== "Celsius"){
    			$("#Day3temp").text(day3MaxC+"\u00B0C / "+day3MinC+"\u00B0C");
    		if (tempUnit== "Fahrenheit"){
    			$("#Day3temp").text(day3MaxF+"\u00B0F / "+day3MinF+"\u00B0F");
    //		$("#Day3winddegree").text(day3winddegree);
    		if (MyUnit == "Metric"){
    		$("#Day3windspeed").text(day3windkm+" km");
    		if (MyUnit == "Imperial"){
    		$("#Day3windspeed").text(day3windmiles+" miles");
    		if (MyUnit == "Metric"){
    		$("#Day4rain").text(day4precipiMM+" mm");
    		if (MyUnit == "Imperial"){
    		$("#Day4rain").text(day4precipiIN+" in");
    		if (tempUnit== "Celsius"){
    			$("#Day4temp").text(day4MaxC+"\u00B0C / "+day4MinC+"\u00B0C");
    		if (tempUnit== "Fahrenheit"){
    			$("#Day4temp").text(day4MaxF+"\u00B0F / "+day4MinF+"\u00B0F");
    //		$("#Day4winddegree").text(day4winddegree);
    		if (MyUnit == "Metric"){
    		$("#Day4windspeed").text(day4windkm+" km");
    		if (MyUnit == "Imperial"){
    		$("#Day4windspeed").text(day4windmiles+" miles");
    		if (MyUnit == "Metric"){
    		$("#Day5rain").text(day5precipiMM+" mm");
    		if (MyUnit == "Imperial"){
    		$("#Day5rain").text(day5precipiIN+" in");
    		if (tempUnit== "Celsius"){
    			$("#Day5temp").text(day5MaxC+"\u00B0C / "+day5MinC+"\u00B0C");
    		if (tempUnit== "Fahrenheit"){
    			$("#Day5temp").text(day5MaxF+"\u00B0F / "+day5MinF+"\u00B0F");
    //		$("#Day5winddegree").text(day5winddegree);
    		if (MyUnit == "Metric"){
    		$("#Day5windspeed").text(day5windkm+" km");
    		if (MyUnit == "Imperial"){
    		$("#Day5windspeed").text(day5windmiles+" miles");
    Next is the translation javascript file. WorldWeatherOnline also used 47 different weather conditions, just like Yahoo, but they are however quite different and also have different codes.

    function ConditionNames(code){
    if (LangTranslate == "English") 
    	switch (code)
    case "395": {return "Heavy snow & thunder"}	
    case "392": {return "Light snow & thunder"}
    case "389": {return "Heavy rain & thunder"}
    case "386": {return "Light rain & thunder"}
    case "377": {return "Heavy hail"}
    case "374": {return "Light hail"}
    case "371": {return "Heavy snow showers"}
    case "368": {return "Light snow showers"}
    case "365": {return "Heavy sleet showers"}
    case "362": {return "Light sleet showers"}
    case "359": {return "Very heavy rain showers"}
    case "356": {return "Heavy rain showers"}
    case "353": {return "Light rain showers"}
    case "350": {return "Hail"}
    case "338": {return "Heavy snow"}
    case "335": {return "Patchy heavy snow"}
    case "332": {return "Moderate snow"}
    case "329": {return "Moderate patchy snow"}
    case "326": {return "Light snow"}
    case "323": {return "Patchy light snow"}
    case "320": {return "Heavy sleet"}
    case "317": {return "Light sleet"}
    case "314": {return "Heavy freezing rain"} 
    case "311": {return "Light freezing rain"}
    case "308": {return "Heavy rain"}
    case "305": {return "Partly heavy rain"}
    case "302": {return "Moderate rain"}
    case "299": {return "Partly moderate rain"}
    case "296": {return "Light rain"}
    case "293": {return "Patchy light rain"}
    case "284": {return "Heavy freezing drizzle"}
    case "281": {return "Freezing drizzle"}
    case "266": {return "Light drizzle"}
    case "263": {return "Patchy light drizzle"}
    case "260": {return "Freezing fog"}
    case "248": {return "Fog"}
    case "230": {return "Blizzard"}
    case "227": {return "Blowing snow"}
    case "200": {return "Isolated thunderstorms"}
    case "185": {return "Patchy freezing drizzle"}
    case "182": {return "Patchy sleet showers"}
    case "179": {return "Patchy snow showers"}
    case "143": {return "Mist"}
    case "122": {return "Overcast"}
    case "119": {return "Cloudy"}
    case "116": {return "Partly cloudy"}
    case "113": {return "Sunny"}
    if (LangTranslate == "Deutsch") 
    	switch (code)
    case "395": {return "Starker Schneefall & Donner"}	
    case "392": {return "Leichter Schneefall & Donner"}
    case "389": {return "Schwerer Regen & Donner"}
    case "386": {return "Leichter Regen & Donner"}
    case "377": {return "Schwerer Hagel"}
    case "374": {return "Leichter Hagel"}
    case "371": {return "Schwerer Schneefall"}
    case "368": {return "Leichter Schneefall"}
    case "365": {return "Schwere Graupelschauer"}
    case "362": {return "Leichte Graupelschauer"}
    case "359": {return "Sehr schwerer Regen"}
    case "356": {return "Schwere Regenschauer"}
    case "353": {return "Leichte Regenschauer"}
    case "350": {return "Hagel"}
    case "338": {return "Schwerer Schneefall"}
    case "335": {return "Teils starker Schneefall"}
    case "332": {return "Mässiger Schneefall"}
    case "329": {return "Teils mässiger Schneefall"}
    case "326": {return "Leichter Schneefall"}
    case "323": {return "Teils leichter Schneefall"}
    case "320": {return "Schneeregen"}
    case "317": {return "Leichter Schneeregen"}
    case "314": {return "Schwerer Eisregen"} 
    case "311": {return "Leichter Eisregen"}
    case "308": {return "Schwerer Regen"}
    case "305": {return "Teils schwerer Regen"}
    case "302": {return "Mässiger Regen"}
    case "299": {return "Teils mässiger Regen"}
    case "296": {return "Leichter Regen"}
    case "293": {return "Teils leichter Regen"}
    case "284": {return "Schwerer Eis-Nieselregen"}
    case "281": {return "Eis-Nieselregen"}
    case "266": {return "Leichter Nieselregen"}
    case "263": {return "Teils leichter Nieselregen"}
    case "260": {return "Gefrierender Nebel"}
    case "248": {return "Nebel"}
    case "230": {return "Schneesturm"}
    case "227": {return "Schneetreiben"}
    case "200": {return "Isolierte Gewitter"}
    case "185": {return "Teils Eis-Nieselregen"}
    case "182": {return "Teils Graupelschauer"}
    case "179": {return "Teils Schneeschauer"}
    case "143": {return "Nebel"}
    case "122": {return "Bedeckt"}
    case "119": {return "Bewölkt"}
    case "116": {return "Teils bewölkt"}
    case "113": {return "Sonnig"}
    if (LangTranslate == "Italian") 
    	switch (code)
    case "395": {return "Forti nevicate e tuono"}	
    case "392": {return "Pioggia e tuoni"}
    case "389": {return "Forti piogge e tuoni"}
    case "386": {return "Pioggia e tuoni"}
    case "377": {return "Grandine pesante"}
    case "374": {return "Grandine Luce"}
    case "371": {return "Rovesci di neve pesanti"}
    case "368": {return "Rovesci di neve leggera"}
    case "365": {return "Docce nevischio pesanti"}
    case "362": {return "Docce sleet Luce"}
    case "359": {return "Rovesci di pioggia molto pesante"}
    case "356": {return "Rovesci di pioggia pesanti"}
    case "353": {return "Pioggia di luce"}
    case "350": {return "Salve"}
    case "338": {return "Forti nevicate"}
    case "335": {return "Leggera neve pesante"}
    case "332": {return "neve moderata"}
    case "329": {return "Moderato neve a chiazze"}
    case "326": {return "Pioggia"}
    case "323": {return "Leggera pioggia"}
    case "320": {return "Nevischio pesante"}
    case "317": {return "Nevischio leggero"}
    case "314": {return "Pesante pioggia gelata"} 
    case "311": {return "Leggera pioggia gelata"}
    case "308": {return "Pioggia"}
    case "305": {return "Pioggia pioggia pesante"}
    case "302": {return "Pioggia moderata"}
    case "299": {return "Pioggia pioggia moderata"}
    case "296": {return "Coperto"}
    case "293": {return "Sereno nuvoloso"}
    case "284": {return "Heavy pioggerella congelamento"}
    case "281": {return "Pioggia di congelamento"}
    case "266": {return "Pioggia leggera"}
    case "263": {return "Luce Pioggia leggera"}
    case "260": {return "Nebbia di congelamento"}
    case "248": {return "Nebbia"}
    case "230": {return "Bufera di neve"}
    case "227": {return "Bufera di neve"}
    case "200": {return "Temporali isolati"}
    case "185": {return "Leggera pioggerellina congelamento"}
    case "182": {return "Docce nevischio a chiazze"}
    case "179": {return "Pioggia leggera con rovesci di neve"}
    case "143": {return "Letame"}
    case "122": {return "Nuvoloso"}
    case "119": {return "Nuvoloso"}
    case "116": {return "Parzialmente nuvoloso"}
    case "113": {return "Soleggiato"}
    if (LangTranslate == "Spanish") 
    	switch (code)
    case "395": {return "Las fuertes nevadas y truenos"}	
    case "392": {return "Poca nieve y truenos"}
    case "389": {return "Las fuertes lluvias y truenos"}
    case "386": {return "Nublado y truenos"}
    case "377": {return "Granizo pesado"}
    case "374": {return "Granizo ligero"}
    case "371": {return "Duchas pesadas de nieve"}
    case "368": {return "Nevadas ligeras"}
    case "365": {return "Chubascos fuertes aguanieve"}
    case "362": {return "Mayormente nublado aguanieve"}
    case "359": {return "Muy fuertes lluvias"}
    case "356": {return "Chubascos fuertes lluvias"}
    case "353": {return "Duchas de lluvia ligera"}
    case "350": {return "Granizo"}
    case "338": {return "Las fuertes nevadas"}
    case "335": {return "Fuerte nevada Niebla"}
    case "332": {return "Nieve moderada"}
    case "329": {return "Nieve irregular moderado"}
    case "326": {return "Poca nieve"}
    case "323": {return "Nieve Cloudy"}
    case "320": {return "Aguanieve pesado"}
    case "317": {return "Aguanieve"}
    case "314": {return "Lluvia helada pesada"} 
    case "311": {return "Lluvia helada ligero"}
    case "308": {return "Las fuertes lluvias"}
    case "305": {return "Parcialmente pesado"}
    case "302": {return "Lluvia moderada"}
    case "299": {return "Parcialmente moderado"}
    case "296": {return "Nublado"}
    case "293": {return "Lluvia Cloudy"}
    case "284": {return "Llovizna fuerte con heladas"}
    case "281": {return "Llovizna helada"}
    case "266": {return "Llovizna ligero"}
    case "263": {return "Llovizna Cloudy"}
    case "260": {return "Niebla de congelación"}
    case "248": {return "Niebla"}
    case "230": {return "Ventisca"}
    case "227": {return "La nieve que sopla"}
    case "200": {return "Tormentas aisladas"}
    case "185": {return "Llovizna helada Niebla"}
    case "182": {return "Duchas Patchy aguanieve"}
    case "179": {return "Duchas Patchy nieve"}
    case "143": {return "Niebla"}
    case "122": {return "Cubierto"}
    case "119": {return "Nublado"}
    case "116": {return "Mayormente nublado"}
    case "113": {return "Soleado"}
    if (LangTranslate == "French") 
    	switch (code)
    case "395": {return "Fortes chutes de neige et tonnerre"}	
    case "392": {return "Légères chutes de neige et tonnerre"}
    case "389": {return "De fortes pluies et tonnerre"}
    case "386": {return "Faible pluie et tonnerre"}
    case "377": {return "Forte grêle"}
    case "374": {return "Légères grêle"}
    case "371": {return "Fortes chutes de neige"}
    case "368": {return "Légères chutes de neige"}
    case "365": {return "******s grésil lourds"}
    case "362": {return "******s grésil petits"}
    case "359": {return "Très fortes pluies"}
    case "356": {return "Pluie battante"}
    case "353": {return "Averses de pluie fine"}
    case "350": {return "Grêle"}
    case "338": {return "Fortes chutes de neige"}
    case "335": {return "Chute de neige partiellement forte"}
    case "332": {return "Neige modérée"}
    case "329": {return "Modérée de neige éparses"}
    case "326": {return "Neige légère"}
    case "323": {return "Inégale neige"}
    case "320": {return "Neige Fondue"}
    case "317": {return "Légères neige et de la pluie"}
    case "314": {return "Neige légère"} 
    case "311": {return "Neige légère"}
    case "308": {return "Pluie Battante"}
    case "305": {return "Forte Pluie"}
    case "302": {return "Modérée Pluie"}
    case "299": {return "Modérée Pluie éparses"}
    case "296": {return "Faible Pluie"}
    case "293": {return "Partiellement Nuageux"}
    case "284": {return "Une lourde bruine de glace"}
    case "281": {return "Bruine verglaçante"}
    case "266": {return "Nuageux"}
    case "263": {return "Bruine partiellement legere"}
    case "260": {return "Brouillard verglaçant"}
    case "248": {return "Brouillard"}
    case "230": {return "Blizzard"}
    case "227": {return "Blizzard"}
    case "200": {return "Orages"}
    case "185": {return "Brume Glace éparses"}
    case "182": {return "Giboulée éparses"}
    case "179": {return "Averses de neige partiellement"}
    case "143": {return "Brouillard"}
    case "122": {return "Couvert"}
    case "119": {return "Nuageux"}
    case "116": {return "Partiellement nuageux"}
    case "113": {return "Ensoleillé"}
    The final one is the config.js as there are some "switches" in the request javascript

    var MyUnit = "Metric" // Metric for meters and millimeters or Imperial for inches and miles
    var TwentyFourHourClock = "true" //true for 24 hour clock and DD/MM/YY or false for 12 hourAM/PM and MM/DD/YY
    var tempUnit = "Celsius" //Celsius or Fahrenheit temperature units
    var MyKey ="12345abcd12345edfg" //your free WorldWeatherOnline API key
    The rest is to fit the css style to it and refer the ID's to the body tag.
    I have attached the js files and also the weather conditons icons.

    Forgot that I had missed out a tiny alteration. The update normally comes in AM/PM format but I rearranged it to display 24 hour format, hence the update6 further down the WWO.js
    Just replace the
    update = result.data.current_condition[0].observation_time;
    		update = result.data.current_condition[0].observation_time;
    		update1 = update.split(':')[0];
    		update2 = update.split(':')[1];
    		update3 = update2.split('')[0];
    		update4 = update2.split('')[1];
    		update5 = update2.split('')[3];
    		if (update5=='P' && update1<12)	update1=(update1*1+12);
    		if (update5=='P' && update1==12)	update1=(update1*1);
    		if (update5=='A' && update1==12)	update1=("00");
    This is also NOT included in the rar file!
    Last edited by rasputin007; 2013-04-03 at 01:56 AM.
    Nothing is impossible only miracles take a bit longer!
    2013-04-03 12:46 AM
  2. King_O_Hill's Avatar
    Nice job bro!

    I can add this to UniAW and make it to use the auto detect screen size and if WWO is selected, then I can use the appropriate js and CSS files.

    This will give another great option. I suppose I could also translate the weather codes so that it can use all the current ones that most have too.
    Last edited by King_O_Hill; 2013-04-03 at 01:07 AM.

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0
    2013-04-03 01:01 AM
  3. Dacal's Avatar
    Nice. Thank you.

    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.
    2013-04-03 01:12 AM
  4. King_O_Hill's Avatar
    This thread may explode after Dacals info!

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0
    2013-04-03 01:19 AM
  5. 2k1's Avatar
    Alot of code to add to widgets but oh we'll
    2013-04-03 01:20 AM
  6. Bo Troxell's Avatar
    Nice tweak, much better. Setup took a bit but well worth the effort.
    2013-04-03 01:28 AM
  7. King_O_Hill's Avatar
    Lets get started!

    Check out WW3 for iOS 9/10 - Widget-Weather 3.0
    2013-04-03 01:29 AM
  8. rasputin007's Avatar
    WWO has restructured its API last month, they send me an email to apply for a new API key and their url has also changed (new url already in above code). Old keys, like yours King!, will still work until August 2013.
    There is a limit with a free API key and that is 500 request per hour, so if you intend to refresh your weather every 7 seconds you might be in trouble
    Just browse through their site, the info they offer is just great, they even create the request url for you, you just have to pick which service you want, what features you want and then they show you the url. That is service!
    Apparently they also do a location request from latitude and longitude, but have not tried that myself as I still use Google Maps for that, but will give it a go. Yahoo does not know my village name, Google does, will be interesting to see if WWO knows it.
    Last edited by rasputin007; 2013-04-03 at 01:55 AM.
    Nothing is impossible only miracles take a bit longer!
    2013-04-03 01:43 AM
  9. Dacal's Avatar
    Mmmm... Not very accurate for me

    It gives me a location far from my current position (more than 40 miles)... I must look closer, but don't know if for a specific location, it will be a good replacement of Yahoo service.

    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.
    2013-04-03 01:47 AM
  10. rasputin007's Avatar
    The location response file gives many locations, not sure how to pick the right one. If you use the location request file in your computer browser you'll see the JSON response file.
    It actually knows my village, but it is the third one it listed.
    Nothing is impossible only miracles take a bit longer!
    2013-04-03 02:00 AM
  11. Dacal's Avatar
    The location response file gives many locations, not sure how to pick the right one. If you use the location request file in your computer browser you'll see the JSON response file.
    It actually knows my village, but it is the third one it listed.
    For me, if i try the weather API, i don't find a close location (all are very very far...). If i try the search API with only one result, same thing. If i increase the number of results, my location is found (visible at the top of the JSON, areaname), but all others informations are inaccurate (same as weather API).

    I'm in Tunisia, maybe not a good place to be with this service...

    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.
    2013-04-03 02:13 AM
  12. bfichtner's Avatar
    Can someone help me with what to remove and where to plug this in.

    Start at line #?
    2013-04-03 03:44 AM
  13. bfichtner's Avatar
    Can someone help me with what to remove and where to plug this in.

    Start at line #?
    2013-04-03 07:45 PM
  14. rasputin007's Avatar
    Sad, but looks like it.
    Basically delete any javascript that has anything to do with Yahoo weather, there should be plenty of them, keep all the css styles as you can reuse them, e.g. Yahoo's "desc" is WWO's "weatherdesc", and you want it in the same place, same font, same size, same font color.
    Above's javascripts are basically all you need for a basic conversion. However if your theme/iWidget uses fancy stuff like moonphases etc then of course you have to leave those in, but if they depend on data it got from Yahoo, e.g. sunrise, sunset then you have find alternatives.
    I have played with a javascript that calculates the sunset and sunrise times from your latitude and longitude and the current date. I used it to switch between day and night time background.

    Actually this is the reason why I am posting.
    It is the Google location name javascript which suddenly started to work (never got it going in iOS 5.1.1), it will give you the address of your latitude and longitude.
    My house number is a bit off the ones Google gives me, but checking on Google Maps it is spot on within a few inches, but still the same "wrong" house number.
    It might be useful to get a much much better alternative to Yahoo location and to WWO location.

    function addressLocation() {  
    var url = "http://maps.googleapis.com/maps/api/geocode/json?latlng=" + latitude + "," + longitude + "&sensor=false"
    	$.getJSON(url, function(data) {
    	 var address=data.results[0].formatted_address;
    Last edited by rasputin007; 2013-04-03 at 10:27 PM.
    Nothing is impossible only miracles take a bit longer!
    2013-04-03 08:32 PM
  15. NewD's Avatar
    2013-09-16 11:53 PM
  16. NewD's Avatar
    The location response file gives many locations, not sure how to pick the right one. If you use the location request file in your computer browser you'll see the JSON response file.
    It actually knows my village, but it is the third one it listed.
    Those different locations - are all 'weather stations' near one's home - or lat/long entered.. Most Weather API services I've been reading about see reverse geo-coding as a function of fidning weather stations locations near the coordinates entered. Google, of course would be different, in that it's not a weather service but a location service. Yahoo and WWO and WU are all weather services. So they think of 'location' as a function of where you're going to get your WEATHER info from - which then are weather station locations.

    The reason I've not considered Google as a final solution for getting location data - is that there's no conistency in their DATA RESULT output fields.. One day 'field 1' will give you a township or city and the next location field 1 will give you some other location. There's no consistency to what the output data fields will give you. Only the feed from Yahoo has consistent output fields for location..

    Bing, Google, WWO are all insonsistent. Weather Underground is VERY accurate for city - but ONLY city.. There is no other data in the response file for county or location 2. That's a shame.. Still looking at other weather/location API's out there..
    2013-09-29 11:38 PM