mob41 / kmbeta-api Goto Github PK
View Code? Open in Web Editor NEWAn API to fetch ETA data from KMB routes
License: GNU General Public License v3.0
An API to fetch ETA data from KMB routes
License: GNU General Public License v3.0
Looks like there is a new parameter added to the JSON called returned called "eot".
Any idea what this could be?
https://db.kmbeta.ml/kmbeta_db.json no long exist
Features to be add (or MUST) to the version 2.0.0-SNAPSHOT
I recently found out there is an new parameter in the JSON response in the API.
ex
seems represent expire time. Maybe adding in this API to provide scheduled updates/requests to the KMB's API? (in a Thread)
Example of the response:
Request: (repeated twice/multiple times)
http://etav2.kmb.hk/?action=geteta&lang=en&route=1A&bound=1&stop=SA06T10000&stop_seq=0
Response 1 from first request: (Remaining 1 min)
{
"response":[
{
"ei":"Y",
"eot":"T",
"t":"23:10?? Scheduled",
"w":"Y",
"ex":"2017-01-21 23:20:00"
},
{
"ei":"Y",
"eot":"T",
"t":"23:20?? Scheduled",
"w":"Y",
"ex":"2017-01-21 23:30:00"
},
{
"ei":"Y",
"eot":"T",
"t":"23:30?? Scheduled",
"w":"Y",
"ex":"2017-01-21 23:40:00"
}
],
"updated":1485010839861,
"generated":1485011437419,
"responsecode":0
}
Response 2: (Arrived/Already left)
{
"response":[
{
"ei":"Y",
"eot":"T",
"t":"23:20?? Scheduled",
"w":"Y",
"ex":"2017-01-21 23:30:00"
},
{
"ei":"Y",
"eot":"T",
"t":"23:30?? Scheduled",
"w":"Y",
"ex":"2017-01-21 23:40:00"
},
{
"ei":"Y",
"eot":"T",
"t":"23:40?? Last Bus",
"w":"Y",
"ex":"2017-01-21 23:50:00"
}
],
"updated":1485011444393,
"generated":1485011481461,
"responsecode":0
}
This is a bug in the API since I uploaded the new bus database with UTF-8 encoding.
The InputStreamReader
in BusDatabase.loadDatabase(InputStream in)
is issuing problems as I forget to put a argument with StandardCharsets.UTF-8
.
The library will be moving to Maven Central as seems I know well with publishing Maven Central now.
The library hosting in SF is quite inconvenient for users right? Huh
This really surprised me. The API suddenly changes. The old API no longer works.
The official datafeed is down.
Hi! I was following the quick start guide to setup the api.
First of all, according to the javadoc, getRemainingArrivalTimeText
method doesn't exist anymore. Also, I ran into the following error when I ran my code:
ArrivalManager: Database is not loaded. Loading now...
ArrivalManager: It might take a while...
java.io.IOException: Server returned HTTP response code: 403 for URL: https://db.kmbeta.ml/kmbeta_db.json
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at com.github.mob41.kmbeta.api.BusDatabase.loadWebDB(BusDatabase.java:173)
at com.github.mob41.kmbeta.api.ArrivalManager.<init>(ArrivalManager.java:163)
at com.github.mob41.kmbeta.api.ArrivalManager.<init>(ArrivalManager.java:72)
at test.Test.main(Test.java:17)
ArrivalManager: Could not load database. Check your internet connection or the database file placed near your application.
Exception in thread "main" com.github.mob41.kmbeta.exception.CouldNotLoadDatabaseException: Could not load database. Check your internet connection or the database file placed near your application.
at com.github.mob41.kmbeta.api.ArrivalManager.<init>(ArrivalManager.java:186)
at com.github.mob41.kmbeta.api.ArrivalManager.<init>(ArrivalManager.java:72)
at test.Test.main(Test.java:17)
However, I am able to open https://db.kmbeta.ml/kmbeta_db.json in my Chrome browser, so this shouldn't be the server's problem.
Do you have any idea why this would occur? Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.