![]() ![]() ReplaceIcon = "/Users/mohawke/Geektool/weather.png" LocalIcon = "/Users/mohawke/Geektool/Symbols/%s.png" %myWeather.split('.') To run in Geektool, open shell and add: python /path/to/your/weather.pyĭon't forget the change the paths to the image files below.įorcasts.append(i ': ' i '\n') Including the weather icon buy pointing to your icon set or change You can now simply build your output from a simple key/val dictionary 'title': dom.getElementsByTagName('title').firstChild.data, 'current_temp': ycondition.getAttribute('temp'), 'current_condition': ycondition.getAttribute('text'), Ycondition = dom.getElementsByTagNameNS(WEATHER_NS, 'condition') Weather_icon = get_attribute(results, 'src')įor node in dom.getElementsByTagNameNS(WEATHER_NS, 'forecast'): Res = re.search(r'%s="(.*?)"' % attr, html)Ĭ = subprocess.Popen(, stdout=subprocess.PIPE) It also will download an animated radar image and gets the weather icon file that you can map to your own icons or, with a minor code edit, download directly from Yahoo. I wrote a Python script as an example to do some weather stuff, which can be edited to work behind the scenes or to directly display weather in Geektool. I had some free time today and was playing with Geektool, which is like the desktop toys I used to play with years ago on Linux – SuperKaramba comes to mind. Python library to make consumption of the data fairly simple. 2016 update: Be aware that Yahoo no longer offers weather data, at least not free. 1, 2019: Some tools you might find useful.Īug. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |