No need to enter your location or edit the code; it will use your public IP address to determine your approximate location and pull weather data (in celsius) from openweathermap.org. This dynamic location capability is extremely useful if you travel a lot.
I've separated the code into 4 different geeklets so you can format the 4 elements independently:
- Current temperature and weather condition
- Daily low and high temperature
- Sunrise and sunset times
- Current city and country
23°C, scattered clouds -1°C, clear skies
Displaying and Editing Location
You can check the city and country that is being used (based on your public IP) by running the "citycountry.glet" geeklet. If the city/country displayed is not accurate, go into the code for any of the weather geeklets attached and look for the following two lines:
and manually replace them with numbers pertaining to your longitude and latitude. For example:
Please set the shell's refresh rate to more than 2 minutes. Reasoning: the code is using my personal API key to access data from openweathermap.org. The limit for my personal API key is 60 queries per minute. So if too many people use this code and more than 60 queries occur per minute, some people will experience denial-of-service errors.