Trafikkflyt – API usage
After speaking briefly with a co-worker earlier today about the service that the radio channel P4 (Norwegian) offers, I decided to make a Java framework that can easily be used to get the information from this service. Shortly told, this service is continously updated with traffic news – roads blocked and other information that is important to people on the road.
The framework works in the manner that you can either get all the current events, or limit it to an area of your choice. The area codes you can use is defined in the source code – and can also be found on the developer page for Trafikkflyt. You find that page by browsing to the bottom of the main page, and click the «For Utviklere» link.
The framework will grab the following fields and create elements for each:
- Title of the event
- Link to the event (Trafikkflyt)
- Published date
- Published date (date object)
- Published date (formatted)
- Google maps generated link
The source also comes with a test program that can be used to test the output.
Make sure you read and understand the terms of usage before implementing this framework into your projects. You can also grab a copy of the API to better understand the possibillities.
Check the service providers webpage (Norwegian)