Compare commits
	
		
			No commits in common. "4a4ee88c72c5a7fdd77a4d50734eb1c829d706d7" and "8826be46375219158ec4bb68379f2305ab593b87" have entirely different histories. 
		
	
	
		
			4a4ee88c72
			...
			8826be4637
		
	
		| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
config.toml
 | 
			
		||||
							
								
								
									
										42
									
								
								README.md
								
								
								
								
							
							
						
						
									
										42
									
								
								README.md
								
								
								
								
							| 
						 | 
				
			
			@ -5,46 +5,6 @@ Display bus departures for specific routes on specific stops.
 | 
			
		|||
Usage:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
./busdepartures -c=CONFIGFILE [ -p=PORT]
 | 
			
		||||
./busdepartures[ -p=PORT]
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Configuration
 | 
			
		||||
 | 
			
		||||
The configuration file describes the list of quays (or stops) and the routes for
 | 
			
		||||
each quay that you're interested in. Each quay in your configuration should look
 | 
			
		||||
something like this:
 | 
			
		||||
 | 
			
		||||
```toml
 | 
			
		||||
[[quays]]
 | 
			
		||||
id = "NL:Q:40004001"
 | 
			
		||||
name = "Centraal Station"
 | 
			
		||||
town = "Arnhem"
 | 
			
		||||
routes_of_interest = [
 | 
			
		||||
    {"short_name" = "51", "long_name" = "Wageningen"},
 | 
			
		||||
    {"short_name" = "352", "long_name" = "Wageningen"},
 | 
			
		||||
]
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Note that the `[[quay]]` syntax is TOML's way of describing a list, meaning you
 | 
			
		||||
can keep repeating the example above in your configuration to add multiple
 | 
			
		||||
quays. If you would like an example, see the `config.toml.example` file. It
 | 
			
		||||
lists multiple quays.
 | 
			
		||||
 | 
			
		||||
### Finding the information required for configuration
 | 
			
		||||
 | 
			
		||||
1. Open [the Connexxion halte-informatie page](https://www.connexxion.nl/nl/resultaten/halte-informatie).
 | 
			
		||||
2. Open your browser's developer tooling and go to the 'network' tab.
 | 
			
		||||
3. Search for your stop on the website and open it.
 | 
			
		||||
4. In the network tab, there should be a request labeled 'departures'. Open it.
 | 
			
		||||
 | 
			
		||||
The response is in JSON format and contains all the information you need.
 | 
			
		||||
 | 
			
		||||
- The quay ID is almost exactly the `stopid`, just replace the `:S:` with `:Q:`.
 | 
			
		||||
- The `name` and `town` are just below the quay ID.
 | 
			
		||||
- All the route information you'll need is available in the `departures` key.
 | 
			
		||||
  - `departures.X.tripdata.route.route_short_name` is what you'll enter as the
 | 
			
		||||
    `short_name`.
 | 
			
		||||
  - `departures.stop_headsign` is what you'll enter as the `long_name`.
 | 
			
		||||
 | 
			
		||||
And that's it. Add the information you found to your `config.toml`, as described
 | 
			
		||||
above and start the application.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										3
									
								
								TODO
								
								
								
								
							
							
						
						
									
										3
									
								
								TODO
								
								
								
								
							| 
						 | 
				
			
			@ -3,9 +3,9 @@
 | 
			
		|||
## 1.0.0
 | 
			
		||||
 | 
			
		||||
[ ] *** Show max two departures per line per stop.
 | 
			
		||||
[ ] *** Read route preferences from env/config.
 | 
			
		||||
[ ] *.. Make the stop name link to Breng's page for that stop.
 | 
			
		||||
[ ] *.. Make the route name link to Breng's page for that route.
 | 
			
		||||
[x] *** Read route preferences from env/config.
 | 
			
		||||
[x] *.. Print times in human-readable format.
 | 
			
		||||
[x] **. Always parse times in Dutch timezone.
 | 
			
		||||
[x] *.. Show max three departures per stop.
 | 
			
		||||
| 
						 | 
				
			
			@ -24,4 +24,3 @@
 | 
			
		|||
[ ] *** Let user search for routes.
 | 
			
		||||
[ ] **. Let user save routes in cookie.
 | 
			
		||||
[ ] **. Show routes that user saved.
 | 
			
		||||
[ ] **. Show live departures times, if available.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,16 +0,0 @@
 | 
			
		|||
[[quays]]
 | 
			
		||||
id = "NL:Q:55000050"
 | 
			
		||||
name = "Station"
 | 
			
		||||
town = "Haarlem"
 | 
			
		||||
routes_of_interest = [
 | 
			
		||||
    {"short_name" = "356", "long_name" = "Amsterdam Bijlmer ArenA"},
 | 
			
		||||
    {"short_name" = "2", "long_name" = "Delftplein/Spaarne Gasth"},
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[quays]]
 | 
			
		||||
id = "NL:Q:30009522"
 | 
			
		||||
name = "Station Bijlmer ArenA"
 | 
			
		||||
town = "Amsterdam"
 | 
			
		||||
routes_of_interest = [
 | 
			
		||||
    {"short_name" = "54", "long_name" = "Gein"},
 | 
			
		||||
]
 | 
			
		||||
		Loading…
	
		Reference in New Issue