Opened 13 years ago

Closed 12 years ago

#3327 closed defect (invalid)

mythweather no longer works due to changes at msnbc

Reported by: anonymous Owned by: ldunning
Priority: major Milestone: unknown
Component: mythweather Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

Mythweather no longer works as msnbc has changed. See Ticket 3303 for weather in mythweb.

Attached is a patch to change mythweather to use xoap.weather.com instead. Attached also is new logos that need to go in mythweather/mythweather/images

This patch also adds some additional info on the "tomorrow" forecast page such as humidity, winds and probability of precipitation. It does quite all fit, but I am hoping some one can help here.

The attached logos need to be rescaled, I'll do that later.

The logo weather_logo.png needs to be added, could someone please help with this?

Attachments (8)

mythweather.diff (25.7 KB) - added by maverik044 13 years ago.
patch to use xoap.weather.com instead.
icons1.zip (254.8 KB) - added by maverik044 13 years ago.
icons part 1
icons2.zip (253.7 KB) - added by maverik044 13 years ago.
icons part 2
icons3.zip (255.6 KB) - added by maverik044 13 years ago.
icons part 3
icons4.zip (147.1 KB) - added by maverik044 13 years ago.
icons part 4
mythweather.patch (26.1 KB) - added by maverik044 13 years ago.
Forgot to strip out some stuff on binary comparison
mythweather2.patch (25.5 KB) - added by maverik044 13 years ago.
replaced previous patches, sorry about that
mythweather3.patch (25.5 KB) - added by maverik044 12 years ago.
Fixes wind speed in forecast

Download all attachments as: .zip

Change History (36)

Changed 13 years ago by maverik044

Attachment: mythweather.diff added

patch to use xoap.weather.com instead.

Changed 13 years ago by maverik044

Attachment: icons1.zip added

icons part 1

Changed 13 years ago by maverik044

Attachment: icons2.zip added

icons part 2

Changed 13 years ago by maverik044

Attachment: icons3.zip added

icons part 3

Changed 13 years ago by maverik044

Attachment: icons4.zip added

icons part 4

comment:1 Changed 13 years ago by maverik044

Please note that weather.com serves up the content in an XML file which is of a define format (defined in their SDK documentation). Therefore it is unlikely to change in the future in a way that will break mythweather.

comment:2 Changed 13 years ago by stuartm

Resolution: wontfix
Status: newclosed

I would rather see someone fix the mythweather-revamp branch.

comment:3 Changed 13 years ago by ianmidd

Does anyone know if this will work on a KnoppMyth? installation (R5D1 in my case)?

comment:4 Changed 13 years ago by Maverik044

Yes it will work as long as you have the mythweather sources from a recent svn. For me it was 13128, but should work with older versions since not much has changed in mythweather. You just need the sources and rebuild.

comment:5 Changed 13 years ago by Maverik044

No problem, I'll convert the patch over to the new mythweather-revamp tonight. Should have a patch ready for tomorrow.

comment:6 Changed 13 years ago by maverik044

Spoke to soon, the mythweather-revamp is more of a major re-write than I thought. It will take a bit longer than I thought to patch. Will still do it, but should the attached patch be applied to the releases-0.20-fixes branch?

comment:7 Changed 13 years ago by stuartm

The revamp uses a different system, although I'm not exactly sure how it works and I'll look at it tonight. As I understand the intent, scripts or methods can be written for different sources. So the current version works for users in North America, further methods can be added for weather sources in other countries. What needs to be done is to create a new method/script which uses a global weather source and this can then become the default.

If better sources of data are available for specific regions or countries then other scripts can be written to override the default source.

comment:8 Changed 13 years ago by maverik044

Ya I gathered the same thing, but I won't be able to use the code from my patch for the current mythweather. But on the bright side, looks like the revamp uses the xml parser which should work great with weather.com. I don't think it will be too hard to weather.com, but there's a lot of code there to understand first. Ya I noticed that about North America as it uses NOAA. Weather.com would be a better default since it provides for international locations also. This is why I chose weather.com for this patch as for patch on 3303 for mythweb weather.

comment:9 Changed 13 years ago by anonymous

until maverik044 fixes mythweather-revamp and that branch is merged, could this patch be applied on trunk as an interim solution ?

comment:10 in reply to:  8 Changed 13 years ago by anonymous

Replying to maverik044:

Weather.com would be a better default since it provides for international locations also. This is why I chose weather.com for this patch as for patch on 3303 for mythweb weather.

Another good place would be rainmaker.wunderground.com, it's a telnet interface, but it hasn't changed in years and years, going back to when the weather underground was a little project at the university of michigan.

comment:11 Changed 13 years ago by anonymous

Resolution: wontfix
Status: closedreopened

I can't get this patch to apply to the latest trunk and my weather still doesn't work. Can someone apply and merge this to the latest trunk and weather plugin in no longer usable.

Changed 13 years ago by maverik044

Attachment: mythweather.patch added

Forgot to strip out some stuff on binary comparison

comment:12 Changed 13 years ago by maverik044

Patch should be applied at mythplugins directory level. patch -p1 < mythweather.patch should work (If not try -p0).

Need to unzip the icons to mythplugins/mythweather/mythweather/images. Need to do this before installing cause the patch updates the installer script to copy the icons to the right place.

A patch to mythweather-revamp branch will follow shortly in another ticket.

comment:13 Changed 13 years ago by anonymous

I keep getting a Malformed patch at line 118 error.

patching file mythweather/mythweather/Makefile Hunk #1 FAILED at 187. patch: malformed patch at line 118: diff -rup ../mythplugins-orig/mythweather/mythweather/weather.cpp ./mythweather/mythweather/weather.cpp

Changed 13 years ago by maverik044

Attachment: mythweather2.patch added

replaced previous patches, sorry about that

comment:14 Changed 13 years ago by maverik044

Sorry about that try mythweather2.patch at the level of mythplugins. Use patch -p1.

I edit the patch manually to remove differences detected of binary files and files that are automatically created in the build process. I deleted some white space that I should not have. This is why the patch failed. Sorry about that.

comment:15 Changed 13 years ago by robert.goodworth@…

I'm running ubuntu 6.10, and have a svn of mythplugins at path /data/myth-svn/mythplugins . i tryed to use your patch to update mythweather using "patch -p1 < mythweather2.patch " in the above dir, but get this response. patch unexpectedly ends in middle of line patch: Only garbage was found in the patch input.

any idea's ?

comment:16 Changed 13 years ago by robert.goodworth@…

disregard, corrupt download

comment:17 Changed 13 years ago by robert.goodworth@…

Feedback: patch works great, i can get weather for Canberra Australia, all information present.

comment:18 Changed 13 years ago by paulh

maverik044

Thanks for looking at this. I was going to start looking at updating svn with this but I'm just a little concerned about the copyright notice that is in the data xml files. I'm just waiting to here what Isaac and the other think before looking further at this.

One thing you could do to improve this is to update the weathertypes.dat file so you can just look up which icon to use from the existing icons rather than adding all those new ones, many of which are duplicates. The reason for this is because not all themes use the default icons, GANT doesn't for example, if the name of the icon is looked up from weathertypes.dat then the other themes can still use there own icons.

comment:19 Changed 13 years ago by maverik044

I had thought about that for the icons, but there are more weather.com icons and I think they are little more descriptive. But I will update to use weathertypes.dat as you request. Give me a day or so. Could make it an option if I can figure that out.

As far as the copyright, take a look at the weather.com SDK. Goto http://www.weather.com/services/xmloap.html to sign up for a partner id and also to get the SDK. We can use the XML feed as long as the terms are met. The terms are spelled out in that document. The weather.com logo needs to be displayed and as I haven't played with themes yet I'm not sure the best way to do that given all the themes that are out there. Technically the mythtv-dev team should sign up for partner id and key. Media-portal uses weather.com if that helps, perhaps speaking with them they can tell you how they met the terms.

comment:20 Changed 13 years ago by Maverik044

Oh one more note, mythweather is already using maps from weather.com; the maps are likely subject to the same terms as the XML weather feed.

comment:21 in reply to:  20 Changed 13 years ago by josh@…

Is there a way to do an in place fix for Mythweather without having to reinstall Mythweb? Thanks.

comment:22 Changed 13 years ago by maverik044

The patch for mythweb weather is totally separate from this patch. See ticket 3303 for mythweb weather. For this patch you need to apply the patch to the source code of mythplugins/mythweather, recompile mythweather, re-install mythweather, install the attached icons manually.

comment:23 in reply to:  15 Changed 12 years ago by anonymous

Hint: If your install directory is /usr/local/share instead of /usr/share, the patch2 won't work. You need to edit the patchfile beforehand and fix the install paths for the images.

comment:24 Changed 12 years ago by mythtv-dev@…

I'd like to see this patch be committed, it was a lot easier than mythweather-revamp. The revamp thing seems to be going in the wrong direction, I'd rather see a script fired from the backend do the internet thing and the frontends just display the data.

comment:25 Changed 12 years ago by anonymous

Minor problem with the patch: it gets the forecast wind speed using <d> tags, those are wind direction, <s> is the tag. I'm going to get 263 mph winds tomorrow!

Changed 12 years ago by maverik044

Attachment: mythweather3.patch added

Fixes wind speed in forecast

comment:26 Changed 12 years ago by maverik044

Thanks for catching that. mythweather3.patch should fix the forecast.

comment:27 in reply to:  19 Changed 12 years ago by anonymous

Replying to maverik044:

The weather.com logo needs to be displayed and as I haven't played with themes yet I'm not sure the best way to do that given all the themes that are out there.

You could replace mythweather/images/logo.png with a weather.com one. I grabbed one from the wikipedia page for weather.com and it works OK. It's got some meaningless marketing tagline but that's their choice. I would guess that most themes either don't cover mythweather or just use that logo. Maybe a note in the mythweather README pointing out the copyright reqs would do for theme authors.

comment:28 Changed 12 years ago by stuartm

Resolution: invalid
Status: reopenedclosed
Ticket locked: set

Now that the revamp has been merged back into trunk I'm closing this. Instead, if supplying patches against the new mythweather open a new ticket.

For licensing reasons we have ruled out using weather.com as a source.

Note: See TracTickets for help on using tickets.