Page 10 of 136 FirstFirst ... 89101112 20 60 110 ... LastLast
Results 181 to 200 of 2706

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: GPS Based HTML Lockscreen Weather Theme

  1. #181
    Livin the iPhone Life KraXik's Avatar
    Join Date
    Mar 2011
    Location
    Winchester, UK
    Posts
    2,636
    Thanks
    2,685
    Thanked 1,757 Times in 894 Posts

    Holy ****. Crazy made the cake and Durben just put the icing on!

    I uninstalled it completely and used just your files you uploaded and it was so easy! Really amazing! Just download and go. No editing anything!

  2. The Following 2 Users Say Thank You to KraXik For This Useful Post:

    chg128 (03-02-2012), The_Durben (03-02-2012)

  3. #182
    Quote Originally Posted by KraXik View Post
    Holy ****. Crazy made the cake and Durben just put the icing on!

    I uninstalled it completely and used just your files you uploaded and it was so easy! Really amazing! Just download and go. No editing anything!
    Thank you
    That was the idea to simplify things in its current state.
    The original way is not so easy for a lot of users as well the ones who don't want to use cracked resources.
    Glad my explanation worked out.

  4. The Following 2 Users Say Thank You to The_Durben For This Useful Post:

    KraXik (03-02-2012), metaserph (03-02-2012)

  5. #183
    Livin the iPhone Life KraXik's Avatar
    Join Date
    Mar 2011
    Location
    Winchester, UK
    Posts
    2,636
    Thanks
    2,685
    Thanked 1,757 Times in 894 Posts

    Quote Originally Posted by The_Durben View Post
    Thank you
    That was the idea to simplify things in its current state.
    The original way is not so easy for a lot of users as well the ones who don't want to use cracked resources.
    Glad my explanation worked out.
    Now all you have to do is give Ian a helping hand implementing the location locator files in UniAW5!

  6. The Following 3 Users Say Thank You to KraXik For This Useful Post:

    chg128 (03-03-2012), Ian Nicoll (03-02-2012), The_Durben (03-02-2012)

  7. #184
    Quote Originally Posted by KraXik View Post
    Now all you have to do is give Ian a helping hand implementing the location locator files in UniAW5!
    I can say for certain Ian knows more about his uniaw than I as well as confident he will do that without any assistance. Plus as crazyvivek said, he will explain how to make the JS useable in other widgets.
    Aside from theming this in a style that I liked my only goal was to make a simple install without the need for *******.
    What I would really like to work on is making the app a settings function with the toggles instead of an app. Feel that is easier for users. It can then be also added as a SB Settings toggle for even easier use.
    Unfotunately I'm not all that comfortable with coding that part but I'm sure someone will get that done eventually.

  8. The Following 4 Users Say Thank You to The_Durben For This Useful Post:

    Ian Nicoll (03-02-2012), KraXik (03-02-2012), metaserph (03-02-2012), stratnik (03-05-2012)

  9. #185
    Theme Creator
    Join Date
    Apr 2008
    Location
    In a state of confusion
    Posts
    1,160
    Thanks
    517
    Thanked 648 Times in 427 Posts

    So, how long before we might see this in Cydia? It is looking very nice guys! So if I'm understanding everything correctly, you currently need to open the app for it to update your location, or does it do it automatically? And you can put in your own images right?

  10. #186
    Quote Originally Posted by The_Durben View Post
    This works for non uuid enabling when the app is installed as a deb
    Or if you use the Download to phone method and click the ipa, click zip viewer, click extract all files and then copy the MyLocation.app from the payload folder and place it in var/stash/Applications.xxxx
    This is my modified js w/ the stock theme in the DL below.

    http://db.tt/NH3pJoYc

    This is crazyvivek's app packaged as a deb by Pathkiller. I had him check permissions after mine didn't work. He is a good dude and kindly helped out. I was waiting for him to say ok before I posted this.
    Download this to your phone. Open MyLocation.zip using ifile and extract all. You will get MyLocation.deb
    Click on that and hit install. It will install to var/stash/Applications.xxxx and ask you to respring.

    http://db.tt/uAjA5tI9


    Until crazyvivek gets it hosted on Cydia which I suggested this is a lot easier than the original method.
    DO NOT install the deb over the Application if it is already in your phone. Remove the App first as well as the theme. Reboot and then install.

    This is similar to the info I sent crazyvivek and let him know it's up to him to do with it what he will.

    crazyvivek, I hope you don't mind me posting this but it's basically the same as what you posted in your download, just easier to use.

    Thank you again for creating this. Truly a game changer!

    Again all, I would have done this sooner but I was waiting on people for an ok. Believe me, I share all I do publicly unless it's made exclusively for a theme and then for obvious reasons I can't.

    Anyway, I hope you all enjoy. And I truly hope crazyvivek is ok with this post.
    This is such great work by him everyone should be using it.
    As the gentleman Ian Nicoll suggested as well, crazyvivek needs a donation link.
    This is revolutionary right here! Absolutely amazing job

    If you grab EPHD by Barsoverbeats it will include an easy install and styled theme to match using the GPSWeather. Definitely worth checking out
    Awesome work on this you guys!!!! One question D, how to change it from displaying Celsius?

  11. #187
    Default Explanation of the Code GetLocation_Weather.js
    Code:
    
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    // Author : Vivek Thakur
    // Date   : 25 Feb 2012
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    
    //Enter your application id.
    
    var appUUID=""
    
    //Example var appUUID="5617189F-4661-4278-841D-4BFF4B1C1314"
    //appUUID is the unique identifier for each installed application on the device. This id will be different
    //if the app is removed and installed again on the same iPhone.
    //In i-FunBox the id can be obtained by navigating to "Raw File System/User/Applications". 
    //Then right click the application name and Click "Copy Path"
    
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    //Do not modify anything below this line unless you know what you are doing.
    //-----------------------------------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    
    var prevlatitude = "";
    var prevlongitude = "";
    var woeid;
    var city;
    var neighborhood;
    var county;
    var LocCode;
    var textLat;
    var textLong;
    var state;
    var neigh_lat_long;
    	//HTML Lockscreen calls this function every 20 seconds
    	 function UpdateLocation() {  
    		//This is jquery function to read data from MyLocation.txt file in a variable "appdata"
    		jQuery.get('../../../../User/Applications/' + appUUID + '/Documents/myLocation.txt', function(appdata) {
    		//Below code reads latitude and longitude from MyLocation.txt
    		//Since it is stored in two lines below code splits and stores in latitude and longitude variable
    			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]);
    			var Yahooappid =""
    			
    			//Since UpdateLocation is called every 20 seconds, we dont want to get the location id every 20 seconds if the location is not changed.
    			//Below if conditions checks if new latitude and longitude is available.
    			//If new latitude and longitude is available we will find WOEID for that location
    			if (prevlatitude != latitude || prevlongitude != longitude) {
    				//Below is url that gets output in JSON format "flags=J"
    				var url = "http://where.yahooapis.com/geocode?location=" + latitude + "+" + longitude + "&gflags=R&flags=J"
    				//Below is jQuery function that reads JSON format returned by the URL
    				//So we send request to the url and read the returned data in variable "data" 
    				//example woeid = data.ResultSet.Results[0].woeid; is the way you read returned woeid into variable woeid
    				$.getJSON(url, function(data) {
    					woeid = data.ResultSet.Results[0].woeid;
    					city = data.ResultSet.Results[0].city;
    					county = data.ResultSet.Results[0].county;
    					neighborhood = data.ResultSet.Results[0].neighborhood;
    					state = data.ResultSet.Results[0].state;
    					//Below we write the returned data to the div on Lockscreen.html
    					if (city != "") {
    						$("#cityname").text(city);
    					}
    					else {
    						$("#cityname").text(county);
    					}
    					
    					//Below we format latitude and longitude to append degree and N or S or W or E
    					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";
    					 }
    					
    					
    					if (neighborhood != "") {
    						neigh_lat_long = neighborhood;
    					}
    					else {
    						neigh_lat_long = state;
    					}
    					//Below code writes latitude and longitude and location name on Lockscreen.html
    					$("#latlong").text(textLat + " " + textLong);
    					$("#neighborhoodname").text(neigh_lat_long);
    									
    					prevlatitude = latitude;
    					prevlongitude = longitude;
    					
    					//Below function is called every 20 minutes if there is no change in latitude and longitude since we are still inside If condition.
    					// OR everytime if there is change in the location
    					// Here we pass woeid for that location to get weather
    					GetWeather(woeid); setInterval('GetWeather(woeid)', 1000*20*60 );
    					
    				});
    			}	
    		});	
    	}
    
    var XMLHttpFactories = [
        function () {
            xhr = new XMLHttpRequest(); xhr.overrideMimeType('text/xml'); 
    		return xhr;
        },
        function () {return new ActiveXObject("Msxml2.XMLHTTP")},
        function () {return new ActiveXObject("Msxml3.XMLHTTP")},
        function () {return new ActiveXObject("Microsoft.XMLHTTP")}
      ];
    
      function getXmlHttpRequest() {
        var xmlhttp = false;
        for (var i=0;i<XMLHttpFactories.length;i++) {
          try {
            xmlhttp = XMLHttpFactories[i]();
          }
          catch (e) {
            continue;
          }
          break;
        }
        return xmlhttp;
      }
    
        function writeResults() {
    		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            // response from the yahoo weather url is stored in response
    		var response = xmlhttp.responseXML;
    		
    		//Below is the way you read a normal xml file
    		// So we read temp(temprature), text(example "Partly cloudy")
    		// Finally we read code. Code is a number and is actually the icon number used by yahoo to
    		//display weather icon
    		// Later we find sunrise and sunset time to get the correct icon based on day or night
    		//All yahoo waether icons on weather.yahoo.com are like 1d,1n,2n,2d ......
    		//You can check this on chrome. Inspect elements.....
    		var effectiveRoot = findChild(findChild(response, "rss"), "channel");
    		var conditionTag = findChild(findChild(effectiveRoot, "item"), "yweather:condition");
    		var temp = conditionTag.getAttribute("temp");
    		var text = conditionTag.getAttribute("text");
    		var code = conditionTag.getAttribute("code");
    		var HighLowTag = findChild(findChild(effectiveRoot, "item"), "yweather:forecast");
    		var high = HighLowTag.getAttribute("high");
    		var low = HighLowTag.getAttribute("low");
    		var day = HighLowTag.getAttribute("day");
    		
    		var SunRiseSet = findChild(effectiveRoot, "yweather:astronomy");
    		var SunRise = SunRiseSet.getAttribute("sunrise");
    		var SunSet = SunRiseSet.getAttribute("sunset");
    			
    		var currentTime = new Date();
    		var currentHours = currentTime.getHours();
    		var currentMinutes = currentTime.getMinutes();
    		if 	(currentHours > 12 ) {
    			currentHours = currentHours -12;
    			currentTimeNow = currentHours + ":" + currentMinutes + " PM";
    			}
    		else if (currentHours == 0 ) {
    			currentHours = 12;
    			currentTimeNow = currentHours + ":" + currentMinutes + " AM";
    			} 	
    		else if (currentHours == 12 ) {
    			currentTimeNow = currentHours + ":" + currentMinutes + " PM";
    			}
    			
    		else {
    			currentTimeNow = currentHours + ":" + currentMinutes + " AM";
    		}
    		//Just a date time compare function to check if it is day on night based on sunrise/sunset
    		currentTimeNow = new Date("1/1/2012 " + currentTimeNow);
    		var SunR =  new Date("1/1/2012 " + SunRise);
    		var SunS =  new Date("1/1/2012 " + SunSet);
    		var iconfix;
    		if ((currentTimeNow>SunR) && (currentTimeNow<SunS)) {
    			//day
    			iconfix = "d";
    		 }
    		 else {
    			//night
    			iconfix = "n";
    		 }
    		
    		//writes temprature, weather text etc on the lock screen.
    		$("#weathertext").text(text);
    		$("#highlowtemp").text("H: " + high + "\u00B0" + " " + "L: " + low + "\u00B0");
    		$("#temp").text(temp + "\u00B0");
    		var imgsrc = "<img id=\"theImg\" src=\"YahooWeatherIcons/" + code + iconfix + ".png\" width=\"125\"/>";
    		$('#weathericon').html(imgsrc);
    	  }
    
        }
    
        function GetWeather(LocCode) {
    		//Below we send xmlttp request to the yahoo url 
    		//The url returns the weather info for that place in xml format
    		//On successful return Function "writeResults" is called
    		//If unsuccessful nothing is called.
    			var url="http://weather.yahooapis.com/forecastrss?u=c&w=" + LocCode;
    	 
          xmlhttp = getXmlHttpRequest();
          if (xmlhttp) {
            url = url;
            xmlhttp.open('GET', url, true);
            xmlhttp.onreadystatechange = writeResults;
            xmlhttp.send(null);
          }
    
        }
    function findChild (element, nodeName)
    {
    	var child;
    	
    	for (child = element.firstChild; child != null; child = child.nextSibling)
    	{
    		if (child.nodeName == nodeName)
    			return child;
    	}
    	
    	return null;
    }

    Let me know if this still needs explanation

  12. The Following 8 Users Say Thank You to crazyvivek For This Useful Post:

    chg128 (03-02-2012), Ian Nicoll (03-02-2012), KraXik (03-02-2012), rasputin007 (03-02-2012), RKO1195 (12-01-2012), Sheff1889 (03-03-2012), stratnik (03-05-2012), The_Durben (03-02-2012)

  13. #188
    Quote Originally Posted by Q_bAn_b View Post
    Awesome work on this you guys!!!! One question D, how to change it from displaying Celsius?
    I used this little add-on in GetLocation_weather.js

    function GetWeather(LocCode) {
    if (isCelsius == false){
    varUnit = 'f'
    }
    else
    {
    varUnit = 'c'
    }

    var url="http://weather.yahooapis.com/forecastrss?u="+varUnit+"&w=" + LocCode;

    xmlhttp = getXmlHttpRequest();
    if (xmlhttp) {
    url = url;
    xmlhttp.open('GET', url, true);
    xmlhttp.onreadystatechange = writeResults;
    xmlhttp.send(null);
    }

    }

    but also added this
    <script type="text/javascript" src="setup.js"></script>
    in the <head> of the LockBackground.html and setup.js is so far a simple one liner
    var isCelsius = true //true for Celsius or false for Fahrenheit

  14. The Following 7 Users Say Thank You to rasputin007 For This Useful Post:

    chg128 (03-02-2012), Ian Nicoll (03-02-2012), jjk454ss (03-02-2012), KraXik (03-02-2012), Schnedi (03-02-2012), Sheff1889 (03-03-2012), The_Durben (03-02-2012)

  15. #189
    Quote Originally Posted by rasputin007 View Post
    I used this little add-on in GetLocation_weather.js

    function GetWeather(LocCode) {
    if (isCelsius == false){
    varUnit = 'f'
    }
    else
    {
    varUnit = 'c'
    }

    var url="http://weather.yahooapis.com/forecastrss?u="+varUnit+"&w=" + LocCode;

    xmlhttp = getXmlHttpRequest();
    if (xmlhttp) {
    url = url;
    xmlhttp.open('GET', url, true);
    xmlhttp.onreadystatechange = writeResults;
    xmlhttp.send(null);
    }

    }

    but also added this

    in the of the LockBackground.html and setup.js is so far a simple one liner
    var isCelsius = true //true for Celsius or false for Fahrenheit
    Thanks!! But I'm about kindergarten level in HTML where in the Js would I drop this?

  16. #190
    Quote Originally Posted by Q_bAn_b View Post
    Thanks!! But I'm about kindergarten level in HTML where in the Js would I drop this?
    Right after this line at the top of the LockBackground.html file
    <title>Geolocation Based Theme</title>
    <script type="text/javascript" src="setup.js"></script>



    Alternatively just change the url in GetLocation_Weather.js in the function GetWeather(LocCode)
    from
    var url="http://weather.yahooapis.com/forecastrss?u=c&w=" + LocCode; (original)
    to
    var url="http://weather.yahooapis.com/forecastrss?u=f&w=" + LocCode; (changed to Fahrenheit)
    Last edited by rasputin007; 03-02-2012 at 03:25 PM.

  17. The Following 2 Users Say Thank You to rasputin007 For This Useful Post:

    Ian Nicoll (03-02-2012), The_Durben (03-02-2012)

  18. #191
    Quote Originally Posted by rasputin007 View Post
    Right after this line at the top of the LockBackground.html file
    <title>Geolocation Based Theme</title>
    Alternatively just change the url in GetLocation_Weather.js in the function GetWeather(LocCode)
    from
    var url="http://weather.yahooapis.com/forecastrss?u=c&w=" + LocCode; (original)
    to
    var url="http://weather.yahooapis.com/forecastrss?u=f&w=" + LocCode; (changed to Fahrenheit)
    Thank you kindly

    Quote Originally Posted by rasputin007 View Post
    Right after this line at the top of the LockBackground.html file
    <title>Geolocation Based Theme</title>
    <script type="text/javascript" src="setup.js"></script>



    Alternatively just change the url in GetLocation_Weather.js in the function GetWeather(LocCode)
    from
    var url="http://weather.yahooapis.com/forecastrss?u=c&w=" + LocCode; (original)
    to
    var url="http://weather.yahooapis.com/forecastrss?u=f&w=" + LocCode; (changed to Fahrenheit)
    The alternative was by far easier. Much appreciated!!
    Last edited by Q_bAn_b; 03-02-2012 at 03:30 PM.

  19. #192
    Quote Originally Posted by rasputin007 View Post
    I used this little add-on in GetLocation_weather.js

    function GetWeather(LocCode) {
    if (isCelsius == false){
    varUnit = 'f'
    }
    else
    {
    varUnit = 'c'
    }

    var url="http://weather.yahooapis.com/forecastrss?u="+varUnit+"&w=" + LocCode;

    xmlhttp = getXmlHttpRequest();
    if (xmlhttp) {
    url = url;
    xmlhttp.open('GET', url, true);
    xmlhttp.onreadystatechange = writeResults;
    xmlhttp.send(null);
    }

    }

    but also added this
    <script type="text/javascript" src="setup.js"></script>
    in the <head> of the LockBackground.html and setup.js is so far a simple one liner
    var isCelsius = true //true for Celsius or false for Fahrenheit
    Nice work

    Also for the German language post. Sent a few over already linked to your post as they asked for it.

  20. The Following 3 Users Say Thank You to The_Durben For This Useful Post:

    crazyvivek (03-02-2012), GAIAStevef (03-02-2012), rasputin007 (03-02-2012)

  21. #193
    Thanks to The_Durben I could play with the GPS Weather Lockscreen.
    Not Elite style but looks good (I hope).



    Credits : crazyvivek, The_Durben and KleinMone

  22. The Following 9 Users Say Thank You to Zooropalg For This Useful Post:

    conflict73 (03-03-2012), jjk454ss (03-02-2012), KraXik (03-02-2012), metaserph (03-02-2012), phil73 (03-02-2012), Schnedi (03-02-2012), Sheff1889 (03-03-2012), stratnik (03-05-2012), The_Durben (03-02-2012)

  23. #194
    Livin the iPhone Life KraXik's Avatar
    Join Date
    Mar 2011
    Location
    Winchester, UK
    Posts
    2,636
    Thanks
    2,685
    Thanked 1,757 Times in 894 Posts

    Amazing font! Please share!

    Edit: and by please share, i mean the whole thing!! Lol!

  24. #195
    Quote Originally Posted by Zooropalg View Post
    Thanks to The_Durben I could play with the GPS Weather Lockscreen.
    Not Elite style but looks good (I hope).



    Credits : crazyvivek, The_Durben and KleinMone
    That's gorgeous Zoo!!
    You know I'm a fan of your style already though
    Great work

  25. The Following User Says Thank You to The_Durben For This Useful Post:

    GAIAStevef (03-02-2012)

  26. #196

  27. The Following 10 Users Say Thank You to Zooropalg For This Useful Post:

    chevymusclecar (03-02-2012), conflict73 (03-03-2012), cranko (03-17-2012), Ian Nicoll (03-02-2012), indyzzzz (03-06-2012), KraXik (03-02-2012), metaserph (03-02-2012), Schnedi (03-02-2012), stratnik (03-05-2012), The_Durben (03-02-2012)

  28. #197
    Quote Originally Posted by The_Durben View Post
    This works for non uuid enabling when the app is installed as a deb
    Or if you use the Download to phone method and click the ipa, click zip viewer, click extract all files and then copy the MyLocation.app from the payload folder and place it in var/stash/Applications.xxxx
    This is my modified js w/ the stock theme in the DL below.

    http://db.tt/NH3pJoYc

    This is crazyvivek's app packaged as a deb by Pathkiller. I had him check permissions after mine didn't work. He is a good dude and kindly helped out. I was waiting for him to say ok before I posted this.
    Download this to your phone. Open MyLocation.zip using ifile and extract all. You will get MyLocation.deb
    Click on that and hit install. It will install to var/stash/Applications.xxxx and ask you to respring.

    http://db.tt/uAjA5tI9


    Until crazyvivek gets it hosted on Cydia which I suggested this is a lot easier than the original method.
    DO NOT install the deb over the Application if it is already in your phone. Remove the App first as well as the theme. Reboot and then install.

    This is similar to the info I sent crazyvivek and let him know it's up to him to do with it what he will.

    crazyvivek, I hope you don't mind me posting this but it's basically the same as what you posted in your download, just easier to use.

    Thank you again for creating this. Truly a game changer!

    Again all, I would have done this sooner but I was waiting on people for an ok. Believe me, I share all I do publicly unless it's made exclusively for a theme and then for obvious reasons I can't.

    Anyway, I hope you all enjoy. And I truly hope crazyvivek is ok with this post.
    This is such great work by him everyone should be using it.
    As the gentleman Ian Nicoll suggested as well, crazyvivek needs a donation link.
    This is revolutionary right here! Absolutely amazing job

    If you grab EPHD by Barsoverbeats it will include an easy install and styled theme to match using the GPSWeather. Definitely worth checking out

    Thanks for it,,,,,,,,will post the LC mod if people like it !

  29. The Following User Says Thank You to chg128 For This Useful Post:

    The_Durben (03-02-2012)

  30. #198
    Quote Originally Posted by Zooropalg View Post
    Thanks bro

    The link to download is here > Essai%20GPS%20Weather%20LS1.zip
    You're awesome Zoo!

  31. The Following 2 Users Say Thank You to The_Durben For This Useful Post:

    KraXik (03-02-2012), Zooropalg (03-02-2012)

  32. #199
    Livin the iPhone Life KraXik's Avatar
    Join Date
    Mar 2011
    Location
    Winchester, UK
    Posts
    2,636
    Thanks
    2,685
    Thanked 1,757 Times in 894 Posts

    This is so freaking amazing. I downloaded Zoo's lock, activated in Winterboard..... and that's it. I can't believe it is that easy!! How has it taken so long for some genius to come up with something like this?!

  33. The Following 2 Users Say Thank You to KraXik For This Useful Post:

    The_Durben (03-02-2012), Zooropalg (03-02-2012)

  34. #200
    Default Simplified code that can be used with other weather widgets!
    Below is the simplified code that can be used with other weather widgets.
    You may ignore the appUUID thing as Durben has already a workaround for that. Thanks Durben.

    Code:
    //Enter your application id.
    
    var appUUID=""
    
    //Example var appUUID="5617189F-4661-4278-841D-4BFF4B1C1314"
    
    var prevlatitude = "";
    var prevlongitude = "";
    var woeid;
    var LocCode;
    var textLat;
    var textLong;
          function UpdateLocation() {  
    		jQuery.get('../../../../User/Applications/' + appUUID + '/Documents/myLocation.txt', function(appdata) {
    		//jQuery.get('<PATH TO 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]);
    			var Yahooappid =""
    			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;
    					prevlatitude = latitude;
    					prevlongitude = longitude;
    					GetWeather(woeid); setInterval('GetWeather(woeid)', 1000*20*60 );
    					
    				});
    			}	
    		});	
    	}
    
    	function GetWeather(locationid) {
    		// Your custom code here to get weather from yahoo using woeid
    	
    	}
    I have not tested this code. But it should work.

  35. The Following 12 Users Say Thank You to crazyvivek For This Useful Post:

    bombmom (03-03-2012), chevymusclecar (03-02-2012), chg128 (03-02-2012), Ian Nicoll (03-02-2012), indyzzzz (03-06-2012), KraXik (03-02-2012), metaserph (03-02-2012), Schnedi (03-02-2012), Sheff1889 (03-03-2012), sickchris714 (03-02-2012), stratnik (03-05-2012), The_Durben (03-02-2012)

Page 10 of 136 FirstFirst ... 89101112 20 60 110 ... LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •