The Météo-France Android app has been annoying me for the past 6 months with its excessive battery usage and frustrating UI navigation and experience. Finally this week I had enough and decided to come up with something simple that still gives me the same information on my mobile as the rather excellent France Meteorological office prepares and publishes.
As the French Météo does not publish any of its data in an easily programmable way I decided to do simple screen scraping of their existing forecast website. This is straight-forward enough to do in PHP and actually made considerably easier using the SimpleHTMLDOM library. I highly recommend it. It is the closest I've come to having BeautifulSoup in PHP.
The service is split into two pages:
Scapes and re-renders the Météo data into either a JSON or JSONP format.
Supports the following URL parameters:
||Lowercase name of the region or area you're interested in. E.g. strasbourg, eckbolsheimorsaverne.Defaults to strasbourg|
||The zip code for the area. This should correspond to a zip code available in the area used. Defaults to "67000"|
Relies on support data from the following resources: http://labs.coruscantconsulting.co.uk/strasbourg/meteo/img/spriteCarte40Uvs.png http://labs.coruscantconsulting.co.uk/strasbourg/meteo/img/spriteCarte40Temps.png http://labs.coruscantconsulting.co.uk/strasbourg/meteo/legend.css
Default call in HTML format: http://labs.coruscantconsulting.co.uk/strasbourg/meteo/index.php
Eckbolsheim weather info in HTML format: http://labs.coruscantconsulting.co.uk/strasbourg/meteo/index.php?area=eckbolsheim&zip=67201
Default API response with JSONP callback: http://labs.coruscantconsulting.co.uk/strasbourg/meteo/api.php?callback=weatherdatafunction
This acticle is also available on LinkedIn:
Developer & Programmer with +15 years professional experience building software.
Seeking WFH, remoting or freelance opportunities.