Use Digitransit API
otsaloma opened this issue · comments
Osmo Salomaa commented
Once ready enough for use.
As the new API includes much more vehicles, it might become necessary to filter by a particular stop or by saved favorites, which would imply it to be sensible to merge the map view into Helsinki Transit Stops, which already implements much of that.
If keeping Helsinki Transit Live as in independent application, consider abstracting the provider handling, allowing multiple providers to be used and activated individually.
Osmo Salomaa commented
Seems to work.
#!/usr/bin/env python3
import paho.mqtt.client as mqtt
def on_message(client, userdata, message):
print(message.topic)
print(message.payload.decode("utf_8", errors="replace"))
client = mqtt.Client()
client.on_message = on_message
client.connect("213.138.147.225", port=1883, keepalive=60)
client.subscribe("/hfp/journey/+/+/+/+/+/+/+/60;24/19/#")
client.loop_forever()
Osmo Salomaa commented