tgoulder4 / trainspy Goto Github PK
View Code? Open in Web Editor NEWtrainspy - fast & free real-time train tracker
Home Page: https://www.npmjs.com/package/trainspy
trainspy - fast & free real-time train tracker
Home Page: https://www.npmjs.com/package/trainspy
Lower case station code for findTrains argument not working. convert to upper / complete checks for upper version
findTrains("BRV").thatGoTo(dest).thatDepartOnDate(date).fromTime(time),.aroundTime(time);
new globals:
preferredDestination, startTimeLimit,dateOfDeparture
Insight:
new functions amend the globals which influence results
Default behaviour:
findServices(station).thatDepartOnDate(today).aroundTime(time),.fromTime(time)
tracking the next train that goes to manchester:
trackService(findServices("EUS").thatGoTo("MAN").thatDepartsOnDate(today).aroundTime(now).serviceID))
An update should not be emitted where a badge is present on a pass station.
Actual arrival for destination reached status is null.
Shows concatenated DOM matches
{ status: 'ApproachingAt platform', station: 'Northumberland Park [NUM]Cambridge [CBG]' }
Shows whole route as cancelled : re-define route to new arrival and destination
Emit update_type: 'connection', 'journey', types instead.
Users can choose what type of events they wish to subscribe to.
reduce file size
func tracktrain(service){
thatDepartsOnDate(emitter, date){
getHTML(date)
}
return emitter
}
They enter the date in the form yyyy-mm-dd or 'today' or 'tomorrow'
trackTrain(serviceID).thatDepartsOnDate(date)
sample use
const emitter = trackTrain("P70538").thatDepartsOnDate(today);
emitter.on('journeyUpdate',(data)=>console.log(data))
default behaviour:
trackTrain(serviceID).thatDepartsOnDate(today)
suggested: release-it
e.g. trackTrain("..", today), trackTrain("..", daysFromToday(4))
Drag and drop test html files to tgoulder4.github.io/tests/trainspy/testfile.html,
create test.yaml for actions
Match returns null occasionally. Haven’t replicated. I think it’s a service leaves a non-pass station.
Hi there, thanks for seeking to improve trainspy. Please follow this format for creating an issue:
Move the not departed block to the else section of the if statement in line 85
Use dayjs to Change times into datetime objects with time respective to locale, E.g. '1304 1/2' → 13:04:05. In another country where this is 22:00 and adjusts accordingly e.g. depart at 22:05
Saved in /bugs
folder
Refresh rate should be varied according to scheduled times.
E.g. upon 30 seconds (+optional delay amount) before time of departure, check every second. This applies to every location.
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.