chaser
08-05-16, 23:09
Hi,
I noticed recently that the Yahoo Weather was not displaying correctly on the Confluence Skin 2nd Info Bar (having previously uncommented the line in the skin that enables the weather to show on this skin).
I took the opportunity to do a bit of digging today, and noticed that the skin refers to a piece of code called YWeather, which was originally written by someone called 2boom. This code links to a Yahoo site, but Yahoo have changed things at their end a bit, and the link no longer works correctly, which then breaks the YWeather code. I'm guessing that anything else that relies on YWeather will also not be working.
I've had a look through the code, made some adjustments, and now have it working again on my Ultimo & Duo2 boxes - albeit, it seems to be a lot slower at zapping than it did before. I'm not sure if it's related to the changes I've made. My Python coding skills are not the best, and I'm sure there's a more elegant way of achieving what I've done. If anyone is interested in looking at or amending the code, the two main parts I adjusted are:
1. Creating a link to download the yahoo xml file.
This was a bit more complicated that I thought is should be! I tried doing this in a single line, but the combination of '%20' (for spaces), and '%s' (for the variable location id) in the URL didn't seem to work very well. This is why I've split the URL generation into 3 lines of code - plus a couple of other lines to actually download the yahoo xml file (which is actually called YWeather_tmp.xml).
2. Inserting new lines into the downloaded Yahoo xml file
Currently the downloaded Yahoo xml file, which is downloaded to the tmp folder on the flash, has one very long line that contains most of the weather data. This data is in the following format:
<Something1><Something2>....<something10>
Whereas, it appears that the YWeather code expects each <Something> to be on a separate line:
<Something1>
<Something2>
...
<Something10>
I'm sure it's possible to amend the code to capture relevant info from the single line, but that was beyond me! Instead, I just changed the format of the file so that a new line was inserted between the '>' and '<' symbols.
Anyway, if you're interested in trying it out, I've attached an updated copy of the YWeather.py file, which should be copied to /usr/lib/enigma2/python/Components/Converter. Restart E2 after you've copied the file across to generate the new compiled YWeather.pyo file. Make a backup copy of the existing YWeather.pyo file, before starting this in case you need to revert back (delete the YWeather.py file before you revert back, or you'll keep regenerating the new YWeather.pyo file).
Let me know if it's not working correctly, and I'll see if I can fix it.
Attached file: 48086
I noticed recently that the Yahoo Weather was not displaying correctly on the Confluence Skin 2nd Info Bar (having previously uncommented the line in the skin that enables the weather to show on this skin).
I took the opportunity to do a bit of digging today, and noticed that the skin refers to a piece of code called YWeather, which was originally written by someone called 2boom. This code links to a Yahoo site, but Yahoo have changed things at their end a bit, and the link no longer works correctly, which then breaks the YWeather code. I'm guessing that anything else that relies on YWeather will also not be working.
I've had a look through the code, made some adjustments, and now have it working again on my Ultimo & Duo2 boxes - albeit, it seems to be a lot slower at zapping than it did before. I'm not sure if it's related to the changes I've made. My Python coding skills are not the best, and I'm sure there's a more elegant way of achieving what I've done. If anyone is interested in looking at or amending the code, the two main parts I adjusted are:
1. Creating a link to download the yahoo xml file.
This was a bit more complicated that I thought is should be! I tried doing this in a single line, but the combination of '%20' (for spaces), and '%s' (for the variable location id) in the URL didn't seem to work very well. This is why I've split the URL generation into 3 lines of code - plus a couple of other lines to actually download the yahoo xml file (which is actually called YWeather_tmp.xml).
2. Inserting new lines into the downloaded Yahoo xml file
Currently the downloaded Yahoo xml file, which is downloaded to the tmp folder on the flash, has one very long line that contains most of the weather data. This data is in the following format:
<Something1><Something2>....<something10>
Whereas, it appears that the YWeather code expects each <Something> to be on a separate line:
<Something1>
<Something2>
...
<Something10>
I'm sure it's possible to amend the code to capture relevant info from the single line, but that was beyond me! Instead, I just changed the format of the file so that a new line was inserted between the '>' and '<' symbols.
Anyway, if you're interested in trying it out, I've attached an updated copy of the YWeather.py file, which should be copied to /usr/lib/enigma2/python/Components/Converter. Restart E2 after you've copied the file across to generate the new compiled YWeather.pyo file. Make a backup copy of the existing YWeather.pyo file, before starting this in case you need to revert back (delete the YWeather.py file before you revert back, or you'll keep regenerating the new YWeather.pyo file).
Let me know if it's not working correctly, and I'll see if I can fix it.
Attached file: 48086