rolfberkenbosch / meteoalert-api

MIT License
12 stars 10 forks source link

Atom xml does not exist for a lot of countries (e.g. Germany) #1

Closed kbaikov closed 3 years ago

kbaikov commented 5 years ago

Tried to use the Meteoalert, but got a WrongCountry exception for Germany/Berlin. It looks like the ATOM links you are using do not exist for a lot of countries.

Perhaps a better idea is to use rss? For example: http://www.meteoalarm.eu/documents/rss/de/DE202.rss is for Berlin.

rolfberkenbosch commented 5 years ago

It seems that meteoalarm has a fault on its website. In the root.xml (http://www.meteoalarm.eu/ATOM/root.xml) there are all countries defined but the links are for some countries broken, for example Germany. I will look if it is possible to use for those countries rss instead of xml. There is one downside of that, i cannot split the description field because it is not standardized by meteoalarm.

mmnewmedia commented 3 years ago

there is no solution till now to use the meteoalertapi script (Python) for fetching data from Germany... any suggestions?

mmnewmedia commented 3 years ago

would be nice to have a solution for getting data from germany. with meteoalert I always get errors: Traceback (most recent call last): File "meteoalert.py", line 9, in <module> print(str(meteo.get_alert())) File "/home/larimadora/.local/lib/python3.8/site-packages/meteoalertapi/meteoalertapi.py", line 34, in get_alert feed_data = xmltodict.parse(text) File "/home/larimadora/.local/lib/python3.8/site-packages/xmltodict.py", line 327, in parse parser.Parse(xml_input, True) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 28, column 71 can you help?

rolfberkenbosch commented 3 years ago

I saw some scripts that are able to parse the rss feed. I will look into that and try to add that also to this python script. My goal is to make as user friendly as i can.

mmnewmedia commented 3 years ago

let me know when you add it! would be very happy about that!

roaldnefs commented 3 years ago

Please let me know if you need any help on this issue @rolfberkenbosch, I would be happy to help if needed!

rolfberkenbosch commented 3 years ago

Sorry for my late response. Meteoalarm has finally update their api. All countries support now the atom feed. That means that you can use germany now also. We have to wait when my pull request is merged in home-assistant. I think in the next release next month. For details check: https://github.com/home-assistant/core/pull/51383