hi Crow,
das mit den true hab ich schon, war alt etwas anders weil kein extra wether ordner wie beim ibnWeather.
ich glaub ich habs versaut.
ich poste mal die appleaccuweather und die configureMe aus IBN Weather
kannst du bitte mal gucken wo der fehler liegt? habe fragezeichen aufm screen
appleaccuweather:
// this Widget is made for fun and entertainment purposes...
// hope it all cool and no one has a problome with it....
var MiniIcons = //Fix Up for weatherParser.js but also enables standardisation of sorts
[
"sun", // 1 Sunny
"cloudy1", // 2 Mostly Sunny
"cloudy2", // 3 Partly Sunny
"cloudy3", // 4 Intermittent Clouds
"cloudy4", // 5 Hazy Sunshione
"sun_cloudy2", // 6 Mostly Cloudy
"cloudy5", // 7 Cloudy (am/pm)
"fog", // 8 Dreary (am/pm)
"dunno", // 9 retired
"dunno", // 10 retired
"fog", // 11 fog (am/pm)
"rain3", // 12 showers (am/pm)
"rain1", // 13 Mostly Cloudy with Showers
"sun_rainy", // 14 Partly Sunny with Showers
"tstorm3", // 15 Thunderstorms (am/pm)
"tstorm2", // 16 Mostly Cloudy with Thunder Showers
"tstorm1", // 17 Partly Sunnty with Thunder Showers
"rain2", // 18 Rain (am/pm)
"cloudy10", // 19 Flurries (am/pm)
"cloudy11", // 20 Mostly Cloudy with Flurries
"cloudy12", // 21 Partly Sunny with Flurries
"flurries4", // 22 Snow (am/pm)
"flurries3", // 23 Mostly Cloudy with Snow
"ice", // 24 Ice (am/pm)
"rain&snow", // 25 Sleet (am/pm)
"hail2", // 26 Freezing Rain (am/pm)
"dunno", // 27 retired
"dunno", // 28 retired
"rain&snow", // 29 Rain and Snow Mixed (am/pm)
"sun", // 30 Hot (am/pm)
"overcast", // 31 Cold (am/pm)
"wind030", // 32 Windy (am/pm)
// Night only Icons;
"moon_clear", // 33 Clear
"moon_cloudy2", // 34 Mostly Clear
"moon_cloudy", // 35 Partly Cloudy
"cloudy5", // 36 Intermittent Clouds
"haze", // 37 Hazy
"moon_cloudy2", // 38 Mostly Cloudy
"moon_rainy", // 39 Partly Cloudy with Showers
"rain&clouds", // 40 Mostly Cloudy with Showers
"lightening", // 41 Partly Cloudy with Thunder Showers
"lightening", // 42 Mostly Cloudy with Thunder Showers
"moon_icy", // 43 Mostly Cloudy with Flurries
"flurries4" // 44 Mostly Cloudy with Flurries
];
function findChild (element, nodeName)
{
var child;
for (child = element.firstChild; child != null; child = child.nextSibling)
{
if (child.nodeName == nodeName)
return child;
}
return null;
}
function trimWhiteSpace (string)
{
return string.replace(/^\s*/, '').replace(/\s*$/, '');
}
// returns an anonymous object like so
// object
// error: Boolean false for success
// errorString: failure string
// hi: Fahrenheit
// lo: Fahrenheit
// temp: Fahrenheit
// realFeel: Farenheit
// icon : accuweather icon code
// description: accuweather description
// city: City (first caps)
// time: time 24 hours(nn:nn)
// sunset: time 24 hours (nn:nn)
// sunrise: time 24 hours (nn:nn)
function fetchWeatherData (callback, zip)
{
//var url = 'http://apple.accuweather.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=';
var url = 'http://wu.apple.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=';
if (window.timerInterval != 300000)
window.timerInterval = 300000; // 5 minutes
var xml_request = new XMLHttpRequest();
xml_request.onload = function(e) {xml_loaded(e, xml_request, callback);}
xml_request.overrideMimeType("text/xml");
xml_request.open("GET", url+zip);
xml_request.setRequestHeader("Cache-Control", "no-cache");
xml_request.setRequestHeader("wx", "385");
xml_request.send(null);
return xml_request;
}
function constructError (string)
{
return {error:true, errorString:string};
}
// parses string of the form nn:nn
function parseTimeString(string)
{
var obj = null;
try {
var array = string.match (/\d{1,2}/g);
obj = {hour:parseInt(array[0], 10), minute:parseInt(array[1],10)};
}
catch (ex)
{
// ignore
}
return obj;
}
function parseDayCode (dayCode)
{
return trimWhiteSpace(dayCode).substr (0, 3).toUpperCase();
}
function xml_loaded (event, request, callback)
{
if (request.responseXML)
{
var obj = {error:false, errorString:null};
var adc_Database = findChild (request.responseXML, "adc_Database");
if (adc_Database == null) {callback(constructError("no <adc_Database>")); return;}
var CurrentConditions = findChild (adc_Database, "CurrentConditions");
if (CurrentConditions == null) {callback(constructError("no <CurrentConditions>")); return;}
var tag = findChild (CurrentConditions, "Time");
if (tag != null)
obj.time = parseTimeString (tag.firstChild.data);
else
obj.time = null;
tag = findChild (CurrentConditions, "City");
if (tag == null) {callback(constructError("no <City>")); return;}
obj.city = trimWhiteSpace(tag.firstChild.data.toString()).toLowerCase();
tag = findChild (CurrentConditions, "Temperature");
if (tag == null) {callback(constructError("no <Temperature>")); return;}
obj.temp = parseInt (tag.firstChild.data);
tag = findChild (CurrentConditions, "RealFeel");
if (tag == null) {callback(constructError("no <RealFeel>")); return;}
obj.realFeel = parseInt (tag.firstChild.data);
tag = findChild (CurrentConditions, "WeatherText");
if (tag == null)
obj.description = null;
else
obj.description = trimWhiteSpace(tag.firstChild.data);
tag = findChild (CurrentConditions, "WeatherIcon");
if (tag == null) {callback(constructError("no <WeatherIcon>")); return;}
obj.icon = parseInt (tag.firstChild.data, 10);
obj.icon -= 1; //Accuweather starts at 1
obj.sunset = null;
obj.sunrise = null;
var Planets = findChild (adc_Database, "Planets");
if (Planets != null)
{
tag = findChild (Planets, "Sun");
if (tag != null)
{
var rise = tag.getAttribute("rise");
var set = tag.getAttribute("set");
if (rise != null && set != null)
{
obj.sunset = parseTimeString (set);
obj.sunrise = parseTimeString(rise);
}
}
}
callback (obj);
}
else
{
callback ({error:true, errorString:"XML request failed. no responseXML"}); //Could be any number of things..
}
}
// returns an anonymous object like so
// object
// error: Boolean false for success
// errorString: failure string
// cities: array (alphabetical by name)
// object
// name: city name
// zip: postal code
// state: city state
// refine: boolean - true if the search is too generic
function validateWeatherLocation (location, callback)
{
//var url = 'http://apple.accuweather.com/adcbin/apple/Apple_find_city.asp?location=';
var url = 'http://wu.apple.com/adcbin/apple/Apple_find_city.asp?location=';
var xml_request = new XMLHttpRequest();
xml_request.onload = function(e) {xml_validateloaded(e, xml_request, callback);}
xml_request.overrideMimeType("text/xml");
xml_request.open("GET", url+location);
xml_request.setRequestHeader("Cache-Control", "no-cache");
xml_request.send(null);
}
function xml_validateloaded (event, request, callback)
{
if (request.responseXML)
{
var obj = {error:false, errorString:null, cities:new Array, refine:false};
var adc_Database = findChild (request.responseXML, "adc_Database");
if (adc_Database == null) {callback(constructError("no <adc_Database>")); return;}
var CityList = findChild (adc_Database, "CityList");
if (CityList == null) {callback(constructError("no <CityList>")); return;}
if (CityList.getAttribute('extra_cities') == '1')
obj.refine = true;
for (child = CityList.firstChild; child != null; child = child.nextSibling)
{
if (child.nodeName == "location")
{
var city = child.getAttribute("city");
var state = child.getAttribute("state");
var zip = child.getAttribute("postal");
if (city && state && zip)
{
obj.cities[obj.cities.length] = {name:city, state:state, zip:zip};
}
}
}
callback (obj);
}
else
{
callback ({error:true, errorString:"No Response"});
}
}
function createGoToURL (location)
{
return 'http://apple.accuweather.com/adcbin/apple/Apple_weather.asp?location=' + escape(location);
}
/*
Copyright _ 2005, Apple Computer, Inc. All rights reserved.
NOTE: Use of this source code is subject to the terms of the Software
License Agreement for Mac OS X, which accompanies the code. Your use
of this source code signifies your agreement to such license terms and
conditions. Except as expressly granted in the Software License Agreement
for Mac OS X, no other copyright, patent, or other intellectual property
license or right is granted, either expressly or by implication, by Apple.
*/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
configureMe:
// The location field should be a relatively machine-legible string
// if using the default, Apple/AccuWeather parser (originally from Leopard's Weather.wdgt)
var locale = "Berlin, Germany" //e.g. 'Defiance, Ohio'|'Moscow, Russia'|'Ledyard, AT'|'London, UK'
// Set to 'false' if you'd prefer Farenheit
var isCelsius = true //true|false
// Use 'Real Feel' temperatures where possible, taking into account Wind Chill, Humidity etc.
var useRealFeel = false //true|false
/*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
//Enable Wallpaper and/or Lock Screen
var enableWallpaper = true; //true|false
var enableLockScreen = false; //true|false [Currently, it is suggested that the lockScreen is disabled.]
// Supplied styles are 'originalBubble', 'myopia', 'iconOnly' and 'split'.
// (Add your own to the CSS folder!)
var stylesheetWall = 'iCarbon' //'originalBubble'|'myopia'|'iconOnly'|'split'|'oneLine'
var stylesheetLock = 'iCarbon' //See above.
// The only supplied icon set is 'klear'
// Images must follow the same naming schema as the 'springboard' set (borrowed from KWeather)
var iconSetWall = 'springboard' //'springboard'|'Lockscreen'
var iconExtWall = ".png" //'.png'|.'gif' etc.
var iconSetLock = 'springboard' //See above.
var iconExtLock = '.png' //See above.
/*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*/
// The other available source is 'yahooWeather' which for the 'locale'
// requires a US zip or location code (e.g. UKXX0085 or CHXX0008) from
http://weather.yahoo.com
var source = 'appleAccuweatherStolen' //'appleAccuweatherStolen'|'yahooWeather'
// Please endeavour to set this to a sensible value if you really must change it...
var updateInterval = 35 //Minutes