Created
May 19, 2016 03:29
-
-
Save hisasann/975221cfdca3737077bcd582c4b7907e to your computer and use it in GitHub Desktop.
This file contains 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
// 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