1. Dacal's Avatar
    woeid is same format as Ian's uniAW widget : woeid returned by GPS weather code is a 123456 format. I integrated GPS weather code with success in BaSalt widget (Ian is using nearly the same code, it's mine , so it must work for him too).

    Unfortunatly, for now, it broke my slideshow widget (if didn't have a response from yahoo, my widget turn to a slideshow). Need to have a close look on that.



    For Ian, here is the GetLocation_weather.js i use. I call the refresh script directly in the JQuery function.

    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Author : Vivek Thakur
    // Date : 25 Feb 2012
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Modified by Dacal for BaSalt HD theme.
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------

    var prevlatitude = "";
    var prevlongitude = "";
    var woeid;
    var textLat;
    var textLong;

    function UpdateLocation() {
    jQuery.get('../../../../var/mobile/Documents/myLocation.txt', function(appdata) {
    var myvar = appdata;
    var substr = appdata.split('\n');
    var templatitude=(substr[0]).split('=');
    var templongitude=(substr[1]).split('=');
    var latitude = $.trim(templatitude[1]);
    var longitude = $.trim(templongitude[1]);
    if (prevlatitude != latitude || prevlongitude != longitude) {
    var url = "http://where.yahooapis.com/geocode?location=" + latitude + "+" + longitude + "&gflags=R&flags=J";
    $.getJSON(url, function(data) {
    woeid = data.ResultSet.Results[0].woeid;

    if (latitude < 0) {
    textLat = Math.round(latitude*100)/100 + "\u00B0" + "S";
    }
    else if (latitude > 0){
    textLat = Math.round(latitude*100)/100 + "\u00B0" + "N";
    }
    else {
    textLat = Math.round(latitude*100)/100 + "\u00B0";
    }

    if (longitude < 0) {
    textLong = Math.round(longitude*100)/100 + "\u00B0" + "W";
    }
    else if (longitude > 0) {
    textLong = Math.round(longitude*100)/100 + "\u00B0" + "E";
    }
    else {
    textLong = Math.round(longitude*100)/100 + "\u00B0";
    }

    document.getElementById("coordinates").innerHTML = textLat + " " + textLong;
    prevlatitude = latitude;
    prevlongitude = longitude;

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

    });
    }
    });
    }
    Last edited by Dacal; 2012-03-06 at 11:49 PM.
    2012-03-06 11:40 PM
  2. Destan's Avatar
    I was waiting for this Dacal, get it done mate. We are waiting for this with Basalt Hd !!!
    2012-03-06 11:51 PM
  3. KraXik's Avatar
    Yay!!! Go Dacal!!!
    2012-03-06 11:57 PM
  4. Schnedi's Avatar
    BTW Schnedi can you post the code line for the humidity?
    dang!! i saw your post i forgot to answer, sorry!

    you can get it from my EPHD vertical widget or PM later and i'll send it to you. but PM cause i'll forget it for sure! my memorie is not really good.
    2012-03-06 11:58 PM
  5. bombmom's Avatar
    woeid is same format as Ian's uniAW widget : woeid returned by GPS weather code is a 123456 format. I integrated GPS weather code with success in BaSalt widget (Ian is using nearly the same code, it's mine , so it must work for him too).

    Unfortunatly, for now, it broke my slideshow widget (if didn't have a response from yahoo, my widget turn to a slideshow). Need to have a close look on that.



    For Ian, here is the GetLocation_weather.js i use. I call the refresh script directly in the JQuery function.
    This is awesome Dacal! Now can you explain "I call the refresh script directly in the JQuery function" ? If not I do understand and will wait for you to update this for your theme.
    2012-03-07 12:07 AM
  6. Dacal's Avatar
    This is awesome Dacal! Now can you explain "I call the refresh script directly in the JQuery function" ? If not I do understand and will wait for you to update this for your theme.
    I don't know very well jQuery (but i must learn, i opened a lot of pages on it now . At the beginning, i just tried to pass the woeid variable to my script (to replace the locale variable i use, it's the same format), but it didn't work. The variable seems to be only available in the jQuery function, it's why i call the refresh function by including the line below in the jQuery function :

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

    It's a workaround. Need to make something more clean .
    2012-03-07 12:15 AM
  7. Jephre's Avatar
    After figuring out my own stupid mistake I finally got this working. I kept copying the UUID into where it says //Example UUID:.

    Hey jjk454ss,

    I really like this lockscreen! Do you mind sharing your overlay and the slider? Thanks!
    2012-03-07 12:15 AM
  8. The_Durben's Avatar
    woeid is same format as Ian's uniAW widget : woeid returned by GPS weather code is a 123456 format. I integrated GPS weather code with success in BaSalt widget (Ian is using nearly the same code, it's mine , so it must work for him too).

    Unfortunatly, for now, it broke my slideshow widget (if didn't have a response from yahoo, my widget turn to a slideshow). Need to have a close look on that.



    For Ian, here is the GetLocation_weather.js i use. I call the refresh script directly in the JQuery function.
    Hey Dacal
    If I wanted to add this to a uniaw mod I did, what else am I editing?
    I add the GetWeather js to the JavaScript folder and add the script source to the html
    Lost after that

    Hey jjk454ss,

    I really like this lockscreen! Do you mind sharing your overlay and the slider? Thanks!
    The slider is from EPHD theme
    Last edited by The_Durben; 2012-03-07 at 12:26 AM.
    2012-03-07 12:23 AM
  9. jotka's Avatar
    Hi, has anybody an idea why i get the sunset picture on my screen but the sunrise picture not ?

    GPS Based HTML Lockscreen Weather Theme-img_0059.png
    Edit: Sometimes i shuold think before i write ... problem solved. Sorry.
    Last edited by jotka; 2012-03-07 at 09:48 AM.
    2012-03-07 12:31 AM
  10. Dacal's Avatar
    Hey Dacal
    If I wanted to add this to a uniaw mod I did, what else am I editing?
    I add the GetWeather js to the JavaScript folder and add the script source to the html
    Lost after that
    Put only the code i include above in the GetLocation_Weather.js. You also need to copy jquery library in you javascript folder.
    Put the line in you HTML.

    For me, it looks like that :

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, user-scalable=no" />
    <link rel="stylesheet" href="Resources/Css/Main/Lock.css" type="text/css" media="screen" />
    <script type="text/javascript" charset="utf-8" src="Setup/Config.js"/></script>
    <script type="text/javascript" charset="utf-8" src="Resources/JavaScript/Main/jquery.min.js"/></script>
    <script type="text/javascript" charset="utf-8" src="Resources/JavaScript/Main/Main.js"/></script>
    <script type="text/javascript" charset="utf-8" src="Resources/JavaScript/Main/GetLocation_Weather.js"/></script>
    </head>
    For uniAW (sorry, don't have the widget on this computer), open the main javascript file (one from uniAW) and search for the line "validateWeatherLocation(escape(woeid).replace (/^%u/g, "%"), setPostal);" (in init/onload function, i think) => replace with "UpdateLocation();".

    Not very clean, but it work.

    Forgot ! I include a line to have coordinates (document.getElementById("coordinates").innerHTML = textLat + " " + textLong. Need to add a div in the HTML and appropriate section in CSS. For testing purpose, just delete this line.
    Last edited by Dacal; 2012-03-07 at 12:45 AM.
    2012-03-07 12:42 AM
  11. jjk454ss's Avatar
    Hey jjk454ss,

    I really like this lockscreen! Do you mind sharing your overlay and the slider? Thanks!
    I thought the overlay was in this thread, towards the very beginning. Otherwise its in the EPHD thread, but I don't have it anymore, I've changed widgets too many times since.

    The slider is from EPHD.
    2012-03-07 12:53 AM
  12. rasputin007's Avatar
    Ian's widget calls for something like var locale=4140 so it's the woeid code that is my problem with it too as it doesnt use var locale="CAXX0677" any more
    Ah, that explains a lot, because the location.js provides the old style weather location ID like UKXX0085 and not the woeid. The original GetLocation_Weather.js gets that.
    I needed that old style weather location ID as only that will provide a 5 day forecast on the xml.weather.yahoo.com.
    Cool, problem found!
    2012-03-07 12:56 AM
  13. The_Durben's Avatar
    Put only the code i include above in the GetLocation_Weather.js. You also need to copy jquery library in you javascript folder.
    Put the line in you HTML.

    For me, it looks like that :



    For uniAW (sorry, don't have the widget on this computer), open the main javascript file (one from uniAW) and search for the line "validateWeatherLocation(escape(woeid).replace (/^%u/g, "%"), setPostal);" (in init/onload function, i think) => replace with "UpdateLocation();".

    Not very clean, but it work.

    Forgot ! I include a line to have coordinates (document.getElementById("coordinates").innerHTML = textLat + " " + textLong. Need to add a div in the HTML and appropriate section in CSS. For testing purpose, just delete this line.
    Awesome thanks man.
    Where's the coordinates line go?

    I'll have to try this later, just made changes and messed up somewhere, gotta redownload my uniaw widget
    Can't find what I messed up.
    Appreciate the help man
    2012-03-07 01:10 AM
  14. bombmom's Avatar
    Awesome thanks man.
    Where's the coordinates line go?

    I'll have to try this later, just made changes and messed up somewhere, gotta redownload my uniaw widget
    Can't find what I messed up.
    Appreciate the help man
    Let me know if you get it Derrick because its making me scream,lol You know I hate JavaScript/jQuery
    2012-03-07 01:27 AM
  15. Dacal's Avatar
    Awesome thanks man.
    Where's the coordinates line go?

    I'll have to try this later, just made changes and messed up somewhere, gotta redownload my uniaw widget
    Can't find what I messed up.
    Appreciate the help man
    Just look on the code i post for Ian .

    In the HTML, i add this :

    <div id="coordinates"></div>

    And in the CSS :

    #coordinates{
    position: absolute;
    text-align: center;
    top: 150px;
    left: 0px;
    width: 320px;
    height: 60px;
    font-size: 20px;
    font-weight: bold;
    color: #DCDCDC;
    text-shadow: #000000 0px 0px 2px, #000000 0px 0px 2px ;
    }
    2012-03-07 01:50 AM
  16. bombmom's Avatar
    Okay I now have the weather info showing but not the animations? @Dacal do you have a suggestion where to look for a issue?
    2012-03-07 01:56 AM
  17. The_Durben's Avatar
    Just look on the code i post for Ian .

    In the HTML, i add this :

    <div id="coordinates"></div>

    And in the CSS :

    #coordinates{
    position: absolute;
    text-align: center;
    top: 150px;
    left: 0px;
    width: 320px;
    height: 60px;
    font-size: 20px;
    font-weight: bold;
    color: #DCDCDC;
    text-shadow: #000000 0px 0px 2px, #000000 0px 0px 2px ;
    }
    Thanks again dude

    @Jenn haven't even started over yet.
    Just about to head home from work. I'll try and mess with it later.
    2012-03-07 02:05 AM
  18. bombmom's Avatar
    Thanks again dude

    @Jenn haven't even started over yet.
    Just about to head home from work. I'll try and mess with it later.
    By them maybe I'll have it Its killing me Big D just killing me...lol First one send it to the other of course
    2012-03-07 02:08 AM
  19. Dacal's Avatar
    Okay I now have the weather info showing but not the animations? @Dacal do you have a suggestion where to look for a issue?
    Need to see the code... If weather info are present, it must be a minor things to change. I don't know... Late here. In my bed with my iPad. Nite

    Think i solved my slideshow problem. all is fine. Great thread ! Thx to all !
    Last edited by Dacal; 2012-03-07 at 02:17 AM.


    My themes : Jade HD, Silex HD, BaSalt HD,ToPaz
    All are on Cydia and/or Theme It.
    2012-03-07 02:09 AM
  20. bombmom's Avatar
    Need to see the code... If weather info are present, it must be a minor things to change. I don't know... Late here. In my bed with my iPad. Nite
    Thanks Dacal. G'Night
    2012-03-07 02:13 AM
2,706 ... 1018192021223070120 ...
LINK TO POST COPIED TO CLIPBOARD