departurevision

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package departurevision parses an HTML table showing departure information.

Consider this package highly experimental and subject to break without warning due to the fragile parsing logic used here. Prefer to use the njtapi package wherever possible for a more stable and robust interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides access to HTML-based departure information.

func NewClient

func NewClient(baseURL string) *Client

NewClient creates a new client to access data from a supplied endpoint.

Sample baseURL: http://dv.njtransit.com/mobile/tid-mobile.aspx.

func (*Client) Departures

func (c *Client) Departures(ctx context.Context, station string) ([]njtapi.StationTrain, error)

Departures finds a simplified list of departures given a 2-character station code.

Sample station: NY

This datasource provides less detail than the full API. As a result, most of the fields in the response will not be set or may have values optimized for visual consumption instead of programmatic use. The `ScheduledDepartureDate` field, for example, will only have hour + minute information, not a full date and time. The `Destination` field often includes extra stop indicators and unsupported unicode symbols for the airport and Secaucus Junction.

Directories

Path Synopsis
Package main demos functionality of the `departurevision` library.
Package main demos functionality of the `departurevision` library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL