lukaskollmer / mvg-node Goto Github PK
View Code? Open in Web Editor NEW๐๐ NodeJS client for the Munich Public Transport System
License: MIT License
๐๐ NodeJS client for the Munich Public Transport System
License: MIT License
Hey, cool project!
However, it seems to be at least partially based on code from https://github.com/leftshift/python_mvg_api (indicated by similarities in the code and the fact you forked it a day before publishing this).
My project is also licensed under the MIT license, so what you did is totally fine (and encouraged! Thanks!) as long as you include the original copyright notice (=my name).
It'd be great if you could do that, thanks!
Since #4 was merged, it'd be nice to update the package on NPM. Maybe something like this https://sergiodxa.com/articles/github-actions-npm-publish/ would be helpful?
Hi,
i am using mvg.getRoute()
sometimes it's working fine and sometimes it's throwing Uncaught SyntaxError: Unexpected token < in JSON at position 0
. The stations i tried were Hauptbahnhof
-> Ostbahnhof.
// vue component
async getRoutesOut(){
let routesOut =
await mvg.getRoute(this.route.from, this.route.to)
.then(res =>{
this.routesOut = res;
})
.catch(err => console.log(err));
},
VM553:1 Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Request._callback (C:\Users\user\Documents\code\mvg\node_modules\mvg-node\index.js:16)
at Request.self.callback (C:\Users\user\Documents\code\mvg\node_modules\request\request.js:185)
at Request.emit (events.js:194)
at Request.<anonymous> (C:\Users\user\Documents\code\mvg\node_modules\request\request.js:1161)
at Request.emit (events.js:194)
at IncomingMessage.<anonymous> (C:\Users\user\Documents\code\mvg\node_modules\request\request.js:1083)
at Object.onceWrapper (events.js:282)
at IncomingMessage.emit (events.js:199)
at endReadableNT (_stream_readable.js:1141)
Line 16 in de92076
It seems like it's due to MVG having issues, so maybe there might be a need to catch their error message:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="de">
<title>apps.mvg-fahrinfo.de - Error 500, internal error - ooops</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="de">
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<font> </font>
<p> </p>
<p> </p>
<table style="border-collapse: collapse;" id="AutoNumber1" border="0"
bordercolor="#111111" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td width="30%"> <br>
</td>
<td width="70%"><font face="Arial">
<h2> 500 - interner Fehler</h2>
<p>Leider ist bei der Verarbeitung Ihrer Anfrage ein interner
Fehler aufgetreten.<br>
Bitte versuchen Sie den Zugriff in einigen Minuten erneut.<br>
</p>
<p>Wir entschuldigen uns für evtl. auftretende
Unannehmlichkeiten und<br>
bitten um Ihr Verständnis.<br>
</p>
<p allign="center"> </p>
</font>
<p> </p>
</td>
</tr>
</tbody>
</table>
</body>
</html>
they seem to have shut down the API used here, find a replacement and use that instead
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.