Using the existing command line gopdx
node module as an easy proof of concept. I already had the module installed globally (npm install -g gopdx
) and had a json of my favorite stops by id (as it requires). But in about 3 minutes I was able to turn it into a quick and dirty menubar app. ❇️
-
-
Save rwaldron/3710623b661bd7c61ff0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var menubar = require('menubar') | |
var exec = require('child_process').exec | |
var fs = require('fs') | |
var mb = menubar() | |
mb.on('ready', function ready () { | |
console.log('Ready!') | |
fetchTimes() | |
}) | |
mb.on('show', function show () { | |
fetchTimes() | |
}) | |
function fetchTimes () { | |
exec('gopdx -f', function (err, stdout, stderr) { | |
if (err) return console.log('ERR OH NOE') | |
fs.writeFileSync('index.html', '<pre>' + stdout + '</pre>') | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment