Giter Club home page Giter Club logo

trainspy's People

Contributors

dependabot[bot] avatar tgoulder4 avatar

Watchers

 avatar

trainspy's Issues

4-[MAJOR]-findTrains("").thatDepartOnDate(date)

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))

No support for split services

Shows concatenated DOM matches
{ status: 'ApproachingAt platform', station: 'Northumberland Park [NUM]Cambridge [CBG]' }

Emit different types of updates

Emit update_type: 'connection', 'journey', types instead.
Users can choose what type of events they wish to subscribe to.

3-[MAJOR]-trackTrain("..").that_

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)

Create tests

Drag and drop test html files to tgoulder4.github.io/tests/trainspy/testfile.html,
create test.yaml for actions

Station code issue

Match returns null occasionally. Haven’t replicated. I think it’s a service leaves a non-pass station.

[MUST READ] Rules: Creating an issue 🌻

Hi there, thanks for seeking to improve trainspy. Please follow this format for creating an issue:

  • Attach the link to the RTT webpage: realtimetrains.co.uk/service/gb-nr: {THE SERVICE ID} / {THE DATE} /detailed
  • Describe what happened in as much detail as possible! 🌻

2-Convert times

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

Vary refresh rate

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.

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.