Closed lhark closed 9 years ago
Yep Actually if you reverse engineering the Mettis application available on the store you will see that they are using Phonegap. So the website is a single page application developed with AngularJS (which explains performances). This application making call to some API and here follow the urls that you can look at (JSON format):
I do not think that it has evolved a lot since I fetched these urls. I do not really like how the data is formatted and the API is structured but it is the better choice to go with (I asked them for an API in September '14 and they answered me that they were not providing any API at all).
For implementation, I think we should provide a python API (not in the paiji2 repository) that will work as an interface between the paiji2 module and the above API. I can explain how it works if needed as I already dived into (I think I even have a python API for that, will have to look at it).
I just had a look at the API you found : basicaly, they are using the same GTFS data to answer the queries (for example the stop IDs are the sameas the ones i got). The only thing different is the possibility to get alerts via RSS feed.
We need to choose between a little bit less processing on our side, or a better durability of our module. Indeed the fact that this API is hidden means they one day could chose to completly rewrite it without maintaining backward compatibility, whereas the GTFS format and the transitfeed library are widely used.
This issue was moved to rezometz/django-paiji2-mettis#1
As it seems for now, the mettis schedule is retrieved through the UI of http://lemet.fr but this method is a bit ugly to say the least.
Luckily, Metz has an open data policy and is making quite a lot a data available through the http://data.gouv.fr portal. In particular, they are providing all of the transport network data under the GTFS format, which is a standardized format developed by Google for this very purpose. GTFS reference In our case, the .zip can be found here
Google is even providing a python library that allow for an easy retrieving of the data : https://github.com/google/transitfeed
The only problem with this method is that it seems it will be hard to automate the retrieving of the GTFS file (it is apparently renewed every semester) as data.gouv.fr does not provide an API for this kind of file.