Git Product home page Git Product logo

soss-cli's Introduction

Query California hydrogen station status from the CLI!

Screenshot

(The tables will render correctly in your terminal if emojis are correctly configured).

soss-cli

Build Status

  • πŸ€” Query the CAFCP's Station Operational Status System (SOSS) from the command line

  • πŸ›°οΈ Use geolocation to locate nearest stations

  • β›³ Query stations near point of interest

Installation

You need npm or yarn installed. On macos, install homebrew and run brew install npm, on Debian-flavored Linux, run sudo apt-get install npm.

Then, install globally using npm or yarn:

# With npm
npm install -g soss-cli

# With yarn
yarn global add soss-cli

The soss command will now be available.

Querying

Running without parameters will automatically print help.

soss nearest

Will output a list of stations nearby. If you are running macos, CoreLocation will be used to locate you, otherwise we fallback to IP-based geolocation.

~ ❯❯❯ soss nearest                                                                                                                                ✘ 1
βœ” Getting current location
βœ” Getting station data
βœ” Getting Station Status
╔═════════════╀═══════════════╀═════╀═════╀═════════════╀════════════════════════════════╗
β•‘ πŸš—  Distanceβ”‚ 🏒  Name      β”‚ H35 β”‚ H70 β”‚ πŸ•’  Updated β”‚ πŸ’¬  Message                    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 1.67 mi     β”‚ West LA       β”‚ ❌  β”‚ ❌  β”‚ 11:28:45 AM β”‚ The station is offline for mai β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ ntenance, and we expect to reo β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ pen around Thursday, 3/1. In t β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ he interim, customers can use  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ Santa Monica or other nearby s β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ tations. Please check back for β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ updates. We apologize for any  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ inconvenience.                 β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 3.54 mi     β”‚ Santa Monica  β”‚ βœ…  β”‚ βœ…  β”‚ 11:33:44 AM β”‚                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 4.64 mi     β”‚ Fairfax-LA    β”‚ βœ…  β”‚ βœ…  β”‚ 11:33:44 AM β”‚ The Fairfax station will be of β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ fline for maintenance activiti β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ es all day on 3/6 through 3/7, β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ We will advise as soon as the  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ station returns to operation.  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ We apologize for any inconveni β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ ence this may cause.           β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 7.42 mi     β”‚ Playa Del Rey β”‚ βœ…  β”‚ βœ…  β”‚ 11:31:57 AM β”‚                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 7.50 mi     β”‚ Hollywood     β”‚ βœ…  β”‚ βœ…  β”‚ 11:21:55 AM β”‚                                β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

You can also ask for stations near a particular POI. We use openstreetmap to resolve addresses:

~ ❯❯❯ soss nearest disneyland
βœ” Getting station data
βœ” Getting Station Status
╔═════════════╀═══════════════╀═════╀═════╀═════════════╀════════════════════════════════╗
β•‘ πŸš—  Distance β”‚ 🏒  Name     β”‚ H35 β”‚ H70 β”‚ πŸ•’  Updated  β”‚ πŸ’¬  Message                    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 5.62 mi     β”‚ Anaheim       β”‚ ❌  β”‚ βœ…  β”‚ 10:57:15 AM β”‚ This station will reduce its e β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ nergy consumption (to reduce H β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ 2 costs!) between 12 midnight  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ to 5 AM daily.   Safe, complet β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ e fills will still be achieved β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ during this period, they will  β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ just require a few minutes lon β•‘
β•‘             β”‚               β”‚     β”‚     β”‚             β”‚ ger than routine.              β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 10.72 mi    β”‚ UC Irvine     β”‚ βœ…  β”‚ βœ…  β”‚ 11:03:48 AM β”‚                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 11.16 mi    β”‚ Costa Mesa    β”‚ βœ…  β”‚ βœ…  β”‚ 11:02:09 AM β”‚                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 12.98 mi    β”‚ Newport Beach β”‚ βœ…  β”‚ βœ…  β”‚ 11:09:00 AM β”‚                                β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 14.16 mi    β”‚ Diamond Bar   β”‚ βœ…  β”‚ ⚠️  β”‚ 11:03:47 AM β”‚                                β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

To query an individual station, you can use the status command:

~ ❯❯❯ soss status hayward
βœ” Getting Station Status
βœ” Getting station data
╔═══════╀═════════╀═════╀═════╀═════════════╀════════════════════════════════╗
β•‘ πŸ†”  IDβ”‚ 🏒  Nameβ”‚ H35 β”‚ H70 β”‚ πŸ•’  Updated  β”‚ πŸ’¬  Message                    β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 15023 β”‚ Hayward β”‚ βœ…  β”‚ βœ…  β”‚ 11:02:13 AM β”‚                               β•‘
β•šβ•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•§β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Providing no argument will print all stations in the system.

This project is not affiliated in any way with the California Hydrogen Fuel Cell Partnership.

soss-cli's People

Contributors

no2chem avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.