Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created May 19, 2016 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/975221cfdca3737077bcd582c4b7907e to your computer and use it in GitHub Desktop.
Save hisasann/975221cfdca3737077bcd582c4b7907e to your computer and use it in GitHub Desktop.
// MenuBar title
var displayInMenuBar = '';
// List line
var output = '';
output += '\n';
var options = {
hostname: 'api.trello.com',
path: '/1/lists/<list id>?fields=name&cards=open&card_fields=name&key=<API key>&token=<Token key>',
method: 'GET',
headers: {
}
};
var https = require('https');
var req = https.request(options, function(res) {
var body = '';
res.on('data', function(chunk) {
body += chunk;
});
res.on('end', function() {
var response = JSON.parse(body);
response.cards.forEach(function(element, index) {
output += element.name + ' | length=15 href=https://trello.com/~';
output += '\n';
});
console.log(displayInMenuBar + output);
});
});
req.end();
req.on('error', function(e) {
console.error(e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment