Once we moved to Switzerland 3 year ago we wanted to know what happens around us in the municipality (Gemeinde) where we live, but the only available source was official homepage of Gemeinde. Additionally, we missed information about local news, rules, customs, add did not want to miss important deadlines or opportunities to become good residents and integrate into society.
Now during COVID-19 it becomes even more crucial for residents and their family members to stay informed about latest news and announcements coming from local authorities and service providers. This information should come aggregated, and delivered using convenient channels that allow instant notification. We believe knowing precisely what happens outside is crucial for staying safe and healthy, and helps to maintain daily routine one used to and avoid unnecessary frustration.
Few use-cases to solve:
- not to miss dates when to recycle free paper, carton, metal, etc;
- receive news from local authorities if situation changes;
- obtain information about planned or cancelled events;
- get notifications about interruptions from service providers (electricity, water supply, internet, TV, telephone);
- observe severe weather warnings.
As we are frequent users of Telegram Messenger that serves for us as a default communication platform that we prefer over WhatsApp and Facebook, it was a natural decision to explore its API to see how to deliver above mentioned pieces of information to Telegram Channels.
What it does now
- Checks Severe Weather report from Meteocentrale (http://www.meteocentrale.ch/en/weather/severe-weather-switzerland/severe-weather-report.html) to capture warnings relevant for particular area.
- Checks Network Status for GGA Maur Telecom provider (https://www.gga.ch/de-CH/Support/Netzstatus) and informs if relevant interruptions are found there.
- Checks news website of Local Authority and gets latest news.
- Publishes notifications in the Telegram channel.
How we built it
- First we created two Channels in Telegram: one for our Gemeide and another one for neighbourhood, and started to monitor above mentioned sources of information to understand frequency and format of messages, and posted relevant information manually to the channel.
- Subscribed for newsletters on Gemeinde websites not to miss important updates until we have everything automated.
- Started to automate this activity by creating parsers for above mentioned sources using Codeigniter microframework (it is PHP based, I know might not be the best choice, but it comes with its own pros and cons that we can discuss separately).
Challenges we ran into
- Websites of Local authorities do not offer RSS or any other structured format for news. So we have either to write custom parser for each Gemeinde, or contact them (and their website developer) to add RSS support, or parse newsletter that Gemeinde sends out.
- Meteocentrale.ch also does not offer RSS or API to get wsevere eather warnings, so once again we have to be creative :) Even more, now it is not possible to subscribe for "Severe Weather Mailservice" anymore, because it appears broken (http://www.meteocentrale.ch/en/weather/severe-weather-switzerland/mailservice.html?no_cache=1) - so we had to look under to hood of Meteocentrale website to make it possible to subscribe there.
Accomplishments that we're proud of
- We have 11 and 7 subscribers for our Telegram Channels at the moment.
- Completed parser for Netzstatus of GGA Maur internet provider that is popular provider around Zurich (Greifensee region), Winterthur and St. Gallen.
- Completed parser for Volketswiler Nachrichten website and obtained permission from its Editor to use share their news in Telegram.
- Found way how to get severe weather notifications for all Gemeinde in Switzerland using their ZIP-code.
What we learned
- Seems like there is no any Open API among infrastructure providers in Switzerland (telecom, electricity, etc.) to get information about interruptions, incidents, downtime, etc. So only way to obtain information instantly is to parse website content.
- Same for websites of local authorities: most of them do not have RSS feed, so available options are either website parsing, or email newsletter parsing.
- There are Telegram users in Switzerland :) They are much less then WhatsApp or Facebook Messanger users, but still.
What's next for GeNa: Gemeinde Nachrichen in Telegram
- Contact local authorities, Meteocentrale and infrastructure providers to get access to RSS and possible APIs (if any)
- Add Abfallkalendar (Recycling Calendar) and notifications about upcoming events.
- Add Föhndigram from Meteocentrale (http://www.meteocentrale.ch/en/weather/foehn-and-bise/foehn.html) to detect when Föhn strength exceeds 8hPa level.
- Expand documentation to allows contributors to add custom information sources.
- Allow anyone to consume information using bot notifications.
- Setup more Telegram Infochannels for localities and start promoting them among residents.