Coder Social home page Coder Social logo

kmbeta-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kmbeta-api's Issues

Added eot parameter to JSON?

Looks like there is a new parameter added to the JSON called returned called "eot".

Any idea what this could be?

New parameter in response "ex"

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
}

BusDatabase fails to load database: charset problems

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.

Moving to Maven Central

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

Can't download database

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.