1.0.32 • Published 7 years ago

dublin-bus v1.0.32

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
7 years ago

#Dublin Bus CLI

##Introduction Command-line client for Dublin Bus. Pure NodeJS goodness for retrieving real-time information about buses across Dublin. Absolutely essential, if you use public transportation in this chronically congested city. And cool as well. After all, how many people use a terminal app to check the whereabouts of that feckin' bus? It even works on your Android phone, as shown below!

If you love it, why not rewarding me by a €2 PayPal donation? Every two and a half donation buys me a pint of the good black stuff :-)

Your name will be added to the list of donors and you'll be famous forever, as Internet never forgets!

Merci beaucoup!

Tomasz

##Output This is how it looks like. Dublin Bus loves lolcat :-)

Dublin Bus loves lolcat

##Requirements To run the application, NodeJS must be available on your system. You can find it here: https://nodejs.org/en or install using the package manager of your choice.

On Debian-based Linux machines:

sudo apt install nodejs nodejs-legacy

On Mac OS X:

brew install node

Detailed instructions here: https://nodejs.org/en/download/package-manager/

##Installation Install the application using npm, to make it available as global command

sudo npm install dublin-bus -g

If you're rather interested in source code, install it as local npm module in your preferred folder for funky projects and hacks:

npm install dublin-bus 
cd ./node_modules/dublin-bus
npm install

Alternatively you can pull the project directly from git repository:

git clone https://bitbucket.org/agilisconsultinglimited/dublin-bus.git
cd dublin-bus
npm install

##Usage

Usage: dublin-bus options

Options:

-V, --version  output the application version number
-d, --debug    Display debug information

Commands:

stop <number>                   Displays real-time departures for the specified stop
find <text>                     Finds stop by name and displays real-time departures
                                If more matches found, you will be asked to choose.
route <number> [operator]       Displays route details and all its stops. Dublin Bus
                                operator is assumed, unless specified otherwise.
timetable <stop> <route> [day]  Displays timetable for the specified stop, route and 
                                day. If day is not specified, today is assumed.
help                            Displays help
preferences [...]               Commands for handling preferences, below more details

Examples:

dublin-bus stop 1305            Displays departures at stop 1305
dublin-bus find "Grange"        Finds stops with "Grange" in name
dublin-bus route 17             Displays details and stop list of bus route 17
dublin-bus timetable 1305 17    Displays todas timetable for stop 1305 and bus 17
dublin-bus timetable 1305 17 7  Displays Sunday timetable for stop 1305 and bus 17
dublin-bus preferences list     Displays application preferences

Shorthand syntax is available for quick lookups. Just specify bus number or name without any commands or options:

dublin-bus 1305
dublin-bus "Grange Road"    

##Cowsay mode The app works nicely with cowsay, if you only ask cowsay to keep formatting of the text it receives from dublin-bus application, by adding -n switch. Cowsay also removes all the colors, but there's always lolcat for that ;-)

Examples

dublin-bus stop 1305 | cowsay -n
dublin-bus route 104 | cowsay -n | lolcat

Isn't it cute?

Cow says Dublin Bus

##Make it work on Android phone Yes, it's possible! Follow these steps:

Launch Termux and execute the following commands to prepare the environment and NodeJS platform:

apt update && apt upgrade
apt install coreutils
apt install nodejs
apt install cowsay
node --version

The last command should display version number of the installed NodeJS platform. If it does, proceed with installing the application using the same procedure as on a desktop system. If you choose to use git method, first add git to your phone by running:

apt install git  

Go to the folder where application is installed. If you used npm method, it's:

cd node_modules/dublin-bus-cli

and for git method it's

cd dublin-bus

Launch the application using node intepreter, for example to get the bus stop 1305 information:

node dublin-bus.js 1305
node dublin-bus.js stop 1305 | cowsay -n

And this is the result:

Cow says Dublin Bus on Android Phone

##Preferences In preferences.json file you can store various default settings for the application: ###stops A list of your favourite bus stops. If specified, it will be loaded automatically, if you launch the application without any input parameters. Easy way to quickly check current departures at your usual places.

###Displaying preferences To display current preferences, use the following command:

dublin-bus preferences list     

To add or remove preferred bus stops, use the following commands:

dublin-bus preferences stop add <number>
dublin-bus preferences stop remove <number>         

Note that the above will modify preferences.json file. If you have installed the application as global command, you might receive access denied errors. Run the commands with sudo in such case:

sudo dublin-bus preferences stop add <number>
sudo dublin-bus preferences stop remove <number>
1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

8 years ago

1.0.29

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago