Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5

weather widget hilfe
#1

tach habe ein homescreen weather widget und ein lockscreen weather widget

auf dem lockscreen läuft apple weather tool und auf dem homescreen yahoo weather tool

hätte gerne das homescreen weather auch über apple weather
habe schon viel versucht und probiert. hier mal der weather.html

Code:
<html><head><title>Weather</title></head>



<base href=""/>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>







<script type="text/javascript">



// Enable Greetings

var EnableGreeting = false;



// Enable Weather SpringBoard

var enableWallpaper = true;





// 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 = "GMXX0064" //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 = 'split' //'originalBubble'|'myopia'|'iconOnly'|'split'|'oneLine'

var stylesheetLock = 'split' //See above.



// The only supplied icon set is 'tango'

// Images must follow the same naming schema as the 'springboard' set (borrowed from KWeather)

var iconSetWall = 'mau' //'springboard'|'Lockscreen'

var iconExtWall = ".png" //'.png'|.'gif' etc.

var iconSetLock = 'mau' //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 = 'yahooWeather' //'appleAccuweatherStolen'|'yahooWeather'



// Please endeavour to set this to a sensible value if you really must change it...

var updateInterval = 25 //Minutes





var postal;

var demoMode = false;

var enabled;



if (location.href.indexOf("LockBackground")  == -1){

    stylesheet = stylesheetWall;

    iconSet = iconSetWall;

    iconExt = iconExtWall;

    enabled = enableWallpaper;

}else{

    stylesheet = stylesheetLock;

    iconSet = iconSetLock;

    iconExt = iconExtLock;

    enabled = enableLockScreen;

}



if(enabled == true){

if(iconSet == null || iconSet == 'null' || iconSet == ""){

    var iconSet = stylesheet;

}





var headID = document.getElementsByTagName("head")[0];          

var styleNode = document.createElement('link');

styleNode.type = 'text/css';

styleNode.rel = 'stylesheet';

styleNode.href = 'Stylesheets/'+stylesheet+'.css';

headID.appendChild(styleNode);



var scriptNode = document.createElement('script');

scriptNode.type = 'text/javascript';

scriptNode.src = 'Sources/'+source+'.js';

headID.appendChild(scriptNode);

}



function onLoad(){

    if (enabled == true){

    if (demoMode == true){

        document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+"cloudy1"+iconExt;

        document.getElementById("city").innerText="Somewhere";

        document.getElementById("desc").innerText="Partly Cloudy";

        document.getElementById("temp").innerText="100º";

        

    }else{

    document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+"dunno"+iconExt;

    validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal)

    }

    }else{

        document.getElementsByTagName("body")[0].innerText='';

    }

}



function convertTemp(num)

{

    if (isCelsius == true)

        return Math.round ((num - 32) * 5 / 9);

    else

        return num;

}



function setPostal(obj){

    

    if (obj.error == false){

        if(obj.cities.length > 0){

            postal = escape(obj.cities[0].zip).replace(/^%u/g, "%")

            document.getElementById("WeatherContainer").className = "";    

            weatherRefresherTemp();

        }else{

            document.getElementById("city").innerText="Not Found";

            document.getElementById("WeatherContainer").className = "errorLocaleNotFound";    

        }

    }else{

        document.getElementById("city").innerText=obj.errorString;

        document.getElementById("WeatherContainer").className = "errorLocaleValidate";    

        setTimeout('validateWeatherLocation(escape(locale).replace(/^%u/g, "%"), setPostal)', Math.round(1000*60*5));

    }

}



function dealWithWeather(obj){



    if (obj.error == false){

        document.getElementById("city").innerText=obj.city;

        document.getElementById("desc").innerText=obj.description.toLowerCase();
        translatedesc=obj.description.toLowerCase();
        
         // *******     TRANSLATE DESCRIPTION   ***************************
        // *******     ALWAYS USE SMALL CAPS (i.e 'sunny')   ***************************
           if (translatedesc=='description') { document.getElementById("desc").innerHTML='Your Description';    }
        if (translatedesc=='sunny') { document.getElementById("desc").innerHTML='sonnig';    }
        if (translatedesc=='mostly sunny') { document.getElementById("desc").innerHTML='meist sonnig';    }
        if (translatedesc=='partly sunny') { document.getElementById("desc").innerHTML='teils sonnig';    }
        if (translatedesc=='intermittent clouds') { document.getElementById("desc").innerHTML='teils wolkig';    }
        if (translatedesc=='hazy sunshine') { document.getElementById("desc").innerHTML='diesig und sonnig';    }
        if (translatedesc=='mostly cloudy') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt';    }
        if (translatedesc=='cloudy') { document.getElementById("desc").innerHTML='bew&ouml;lkt';    }
        if (translatedesc=='overcast') { document.getElementById("desc").innerHTML='bew&ouml;lkt';    }
        if (translatedesc=='dreary') { document.getElementById("desc").innerHTML='tr&uuml;b';    }
        if (translatedesc=='retired') { document.getElementById("desc").innerHTML='keine daten verf&uuml;gbar';    }
        if (translatedesc=='fog') { document.getElementById("desc").innerHTML='Nebel';    }
        if (translatedesc=='showers') { document.getElementById("desc").innerHTML='Schauer';    }
        if (translatedesc=='partly sunny with showers') { document.getElementById("desc").innerHTML='teils sonnig mit Schauern';    }
        if (translatedesc=='thunderstorm') { document.getElementById("desc").innerHTML='Gewitter';    }
        if (translatedesc=='mostly cloudy with thunder showers') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt mit Gewitterschauer';    }
        if (translatedesc=='partly sunny with thunder showers') { document.getElementById("desc").innerHTML='teils sonnig mit Gewitterschauer';    }
        if (translatedesc=='light rain') { document.getElementById("desc").innerHTML='leichter Regen';    }
        if (translatedesc=='rain') { document.getElementById("desc").innerHTML='Regen';    }
        if (translatedesc=='flurries') { document.getElementById("desc").innerHTML='windig';    }
        if (translatedesc=='mostly cloudy with flurries') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt und windig';    }
        if (translatedesc=='partly sunny with flurries') { document.getElementById("desc").innerHTML='teils sonnig und windig';    }
        if (translatedesc=='snow') { document.getElementById("desc").innerHTML='Schnee';    }
        if (translatedesc=='mostly cloudy with snow') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt und Schnee';    }
        if (translatedesc=='ice') { document.getElementById("desc").innerHTML='Eis';    }
        if (translatedesc=='sleet') { document.getElementById("desc").innerHTML='Graupelschauer';    }
        if (translatedesc=='freezing rain') { document.getElementById("desc").innerHTML='gefrierender Regen';    }
        if (translatedesc=='rain and snow mixed') { document.getElementById("desc").innerHTML='Schneeregen';    }
        if (translatedesc=='hot') { document.getElementById("desc").innerHTML='heiss';    }
        if (translatedesc=='cold') { document.getElementById("desc").innerHTML='kalt';    }
        if (translatedesc=='windy') { document.getElementById("desc").innerHTML='windig';    }
        if (translatedesc=='clear') { document.getElementById("desc").innerHTML='klar';    }
        if (translatedesc=='mostly clear') { document.getElementById("desc").innerHTML='meist klar';    }
        if (translatedesc=='partly cloudy') { document.getElementById("desc").innerHTML='teils bew&ouml;lkt';    }
        if (translatedesc=='hazy') { document.getElementById("desc").innerHTML='diesig';    }
        if (translatedesc=='partly cloudy with showers') { document.getElementById("desc").innerHTML='teils bew&ouml;lkt mit Regen';    }
        if (translatedesc=='party cloudy with showers') { document.getElementById("desc").innerHTML='teils bew&ouml;lkt mit Schauer';    }
        if (translatedesc=='mostly cloudy with showers') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt mit Schauer';    }
        if (translatedesc=='party cloudy with thunder showers') { document.getElementById("desc").innerHTML='teils bew&ouml;lkt mit Gewitterschauer';    }
        if (translatedesc=='mostly cloudy with showers') { document.getElementById("desc").innerHTML='meist bew&ouml;lkt mit Gewitterschauer';    }
        if (translatedesc=='foggy') { document.getElementById("desc").innerHTML='neblig';    }
        if (translatedesc=='light snow') { document.getElementById("desc").innerHTML='leichter Schneefall'; }        
        if (translatedesc=='rain/drizzle') { document.getElementById("desc").innerHTML='Nieselregen'; }
        if (translatedesc=='mist') { document.getElementById("desc").innerHTML='diesig'; }
        if (translatedesc=='ground fog') { document.getElementById("desc").innerHTML='Bodennebel'; }
        if (translatedesc=='rain shower') { document.getElementById("desc").innerHTML='Schauer';    }
        if (translatedesc=='drizzle') { document.getElementById("desc").innerHTML='Regen';    }
        if (translatedesc=='patches of fog') { document.getElementById("desc").innerHTML='Nebelfelder';    }


                

        // *******   END   TRANSLATE DESCRIPTION   ***************************
        
        
        
        
        

        if(useRealFeel == true){

            tempValue = convertTemp(obj.realFeel);

        }else{

            tempValue = convertTemp(obj.temp)

        }

        document.getElementById("temp").innerText=tempValue+"º";

        document.getElementById("weatherIcon").src="Icon Sets/"+iconSet+"/"+MiniIcons[obj.icon]+iconExt;

        document.getElementById("WeatherContainer").className = "";    



        

    }else{

                document.getElementById("WeatherContainer").className = "errorWeatherDataFetch";    

    }

    

    

}



function weatherRefresherTemp(){ //this is one of my nice works so far... dont forget to find me and thank me "ibnyaffa".

    fetchWeatherData(dealWithWeather,postal);

    setTimeout(weatherRefresherTemp, 60*1000*updateInterval);

}



var MiniIcons =



[

    

    "tstorm3",        //0    tornado

    

    "tstorm3",        //1    tropical storm

    

    "tstorm3",        //2    hurricane

    

    "tstorm3",        //3    severe thunderstorms

    

    "tstorm2",        //4    thunderstorms

    

    "sleet",        //5    mixed rain and snow

    

    "sleet",        //6    mixed rain and sleet

    

    "sleet",        //7    mixed snow and sleet

    

    "sleet",        //8    freezing drizzle

    

    "light_rain",        //9    drizzle

    

    "sleet",        //10    freezing rain

    

    "shower2",        //11    showers

    

    "shower2",        //12    showers

    

    "snow1",        //13    snow flurries

    

    "snow2",        //14    light snow showers

    

    "snow4",        //15    blowing snow

    

    "snow4",        //16    snow

    

    "hail",         //17    hail

    

    "sleet",        //18    sleet

    

    "mist",         //19    dust

    

    "fog",            //20    foggy

    

    "fog",            //21    haze

    

    "fog",            //22    smoky

    

    "cloudy1",        //23    blustery

    

    "wind",         //24    windy

    

    "overcast",        //25    cold

    

    "cloudy5",        //26  cloudy

    

    "cloudy3_night",    //27    mostly cloudy (night)

    

    "cloudy3",        //28    mostly cloudy (day)

    

    "cloudy2_night",    //29    partly cloudy (night)

    

    "cloudy2",        //30    partly cloudy (day)

    

    "sunny_night",        //31    clear (night)

    

    "sunny",        //32    sunny

    

    "mist_night",        //33    fair (night)

    

    "mist",         //34    fair (day)

    

    "hail",         //35    mixed rain and hail

    

    "sunny",        //36    hot

    

    "tstorm1",        //37    isolated thunderstorms

    

    "tstorm2",        //38    scattered thunderstorms

    

    "tstorm2",        //39    scattered thunderstorms



    "tstorm2",        //40    scattered showers



    "snow5",        //41    heavy snow

    

    "snow3",        //42    scattered snow showers

    

    "snow5",        //43    heavy snow

    

    "cloudy1",        //44    partly cloudy

    

    "storm1",        //45    thundershowers

    

    "snow2",        //46    snow showers

    

    "tstorm1",        //47    isolated thundershowers

    

    "dunno",        //3200    not available



]







function constructError (string)

{

    return {error:true, errorString:string};

}



function findChild (element, nodeName)

{

    var child;

    

    for (child = element.firstChild; child != null; child = child.nextSibling)

    {

        if (child.nodeName == nodeName)

            return child;

    }

    

    return null;

}





function fetchWeatherData (callback, zip)

{

    url="http://weather.yahooapis.com/forecastrss?u=f&p=" //u=Farenheit, because accuWeather sucks

    

    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.send(null);

    

    return xml_request;

}



function xml_loaded (event, request, callback)

{

    if (request.responseXML)

    {

        var obj = {error:false, errorString:null};

        var effectiveRoot = findChild(findChild(request.responseXML, "rss"), "channel");

        obj.city = findChild(effectiveRoot, "yweather:location").getAttribute("city");

        obj.realFeel = findChild(effectiveRoot, "yweather:wind").getAttribute("chill");//Only accounts for windChill

        

        conditionTag = findChild(findChild(effectiveRoot, "item"), "yweather:condition");

        obj.temp = conditionTag.getAttribute("temp");

        obj.icon = conditionTag.getAttribute("code");

        obj.description = conditionTag.getAttribute("text");

        callback (obj);

    }else{

        callback ({error:true, errorString:"XML request failed. no responseXML"});

    }

}





function validateWeatherLocation (location, callback)

{

    var obj = {error:false, errorString:null, cities: new Array};

    obj.cities[0] = {zip: location}; //Not very clever, are we?

    callback (obj);

}

</script>









</head>

<body bgcolor="Transparent" onload="onLoad()">



<div id="WeatherContainer"> <div id="TextContainer"> <p id="city">Loading...</p> <p id="temp">...</p> <p id="desc">...</p> </div>

<img id="weatherIcon" src=""/> </div>



</body></html>

kann mir jmd sagen, wie ich es umstelle

dann noch die config.js

Code:
/* Weather Config */
/*---------------------------------- SringBoard options ----------------------------------*/

/* SringBoard weather Enabled?

Not used here

var enableWallpaper = true
*/

/* SytleSheets Pick one from the list and imput its name after var stylesheetWall = "***** */  /* NEW!! */

var stylesheetWall = "split"

/*
                                          Style sheets

1. Bottom
2. Bottom-(White)
3. Top
4. Top-(White)
5. split

*/


/* Icon Styles Pick one from the list and imput its name after var iconSetWall = "***** */  /* NEW!! */

var iconSetWall = "mau"

/*
                                          Icon Sets

1. klear
2. tango
3. rycon
4. mau
5. HTC

*/

/* Icon Extensions Pick one from the list and imput its name after var iconExtWall = "***** */  /* NEW!! */


var iconExtWall = ".png"

/*
                                          Icon Extensions

1. .png
2. .gif

*/


/*---------------------------------- Lockscreen options ----------------------------------*/

/* Lockscreen Enabled? */

var enableLockScreen = false

/* SytleSheets Pick one from the list and imput its name after var stylesheetLock = "***** */  /* NEW!! */

var stylesheetLock = "LockScreen"

/*
                                          Style sheets

1. LockScreen

*/


/* Icon Styles Pick one from the list and imput its name after var iconSetLock = "***** */  /* NEW!! */

var iconSetLock = "tango"

/*
                                          Icon Sets

1. klear
2. tango
3. rycon

*/


/* Icon Extensions Pick one from the list and imput its name after var iconExtLock = "***** */  /* NEW!! */


var iconExtLock = ".png"

/*
                                          Icon Extensions

1. .png
2. .gif

*/


/*---------------------------------- options ----------------------------------*/

/* There are two sources available, 'appleAccuweatherStolen' and 'yahooWeather'. */

var source = "yahooWeather"


/*  Two methodes to set up your location depending on the source:
    accuWeather: 'City, State' (e.g. 'Karlsruhe, Germany')
    yahooWeather: 'US zip' or 'location code' (e.g. Uk Dumbarton = UKXX0663 ) */

var locale = "GMXX0064"

/* Set to 'false' for Farenheit. */

var isCelsius = true

/* AccuWeather RealFeel Temperature Enabled? */

var useRealFeel = false

/* Update interval */

var updateInterval = 30

bitte helft mir

Zitieren
#2

keiner ne hilfe?

bin am verzweifeln
Zitieren
#3

Was für einen Ort willst du den gerne haben?

Ein gutes Wetter-Theme ist WeatherFurik... das benutze ich und wird am Springboard angezeigt...


[Bild: IMG_0006.PNG]

Habe darin schon alles auf Deutsch umgestellt...dies könnte ich dir Schicken...für das Theme
Zitieren
#4

naja würde gerne das behalten, was ich habe, habe alles schon so schön eingestellt,

wenn nich anders geht, nehme ich auch deins
wichtig is halt nur apple weather und stadt ist KIEL 24143

EDIT:

ich meine natührlich das accu weather teil
Zitieren
#5

Hi, sorry war unterwegs... nenne mir bitte die Namen der beiden Wetteranzeigen, dies sind doch in Cydia vorhanden, richtig? Muss mir alles genau anschaun, und auch testen ^^ obs auch passt und funktioniert!

Zitieren
#6

ungetestet:

hast du mal anstatt:
PHP-Code:
var source 'yahooWeather' 

folgendes versucht
PHP-Code:
var source 'appleAccuweatherStolen' 

und dann noch:
PHP-Code:
var locale "EUR|DE|GM016|KIEL|" 

warum das ganze "AppleAccuweatherStolen" heißt, ist mir rätselhaft, wenn das nicht klappt versuch es einfach mit: accuWeather










Zitieren
#7

Das muss schon "AppleAccuweatherStolen" heißen weil die .js auch so heißt, anders würd das schon nicht gehen ... Siehe auch hier http://modmyi.com/forums/iphone-4-new-sk...ost5523076

mfg sagt mokabaer
 ★ iTheming - Mach dein iPhone einzigartig ★ 
Zitieren
#8

(18.10.2010, 23:33)Stigi90 schrieb:  Hi, sorry war unterwegs... nenne mir bitte die Namen der beiden Wetteranzeigen, dies sind doch in Cydia vorhanden, richtig? Muss mir alles genau anschaun, und auch testen ^^ obs auch passt und funktioniert!

leider nicht über cydia zu haben meine ich

es heißt weather widget 0.4
habe es von hier: http://modmyi.com/forums/iphone-2g-3g-3g...hone4.html

download link:
http://www.mediafire.com/?ufn3d6th7pn2c6p

(18.10.2010, 23:54)2Short schrieb:  ungetestet:

hast du mal anstatt:
PHP-Code:
var source 'yahooWeather' 

folgendes versucht
PHP-Code:
var source 'appleAccuweatherStolen' 

und dann noch:
PHP-Code:
var locale "EUR|DE|GM016|KIEL|" 

geht leider auch nicht
habe ich alle schon erfolglos ausprobiert
mit dem was du hattest, kiel, germany, 24143
bei allem kommt nur loading und kein wetter

mhhhhh is zum verrückt werdenWacko
Zitieren


Möglicherweise verwandte Themen…
Thema / Verfasser Antworten Ansichten Letzter Beitrag



Benutzer, die gerade dieses Thema anschauen: 4 Gast/Gäste