Created
January 8, 2014 16:32
-
-
Save serby/8319684 to your computer and use it in GitHub Desktop.
Trello to MD in node.js
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 Trello = require('node-trello') | |
| , t = new Trello('KEY', 'TOKEN') | |
| t.get('/1/boards/bdLKstEV', function(err, data) { | |
| if (err) throw err | |
| console.log('#', data.name, '\n') | |
| console.log('[Source Trello Board](%s)',data.url) | |
| console.log(data.desc, '\n') | |
| t.get('/1/boards/bdLKstEV/lists?cards=open', function(err, data) { | |
| if (err) throw err | |
| listsToMd(data) | |
| }) | |
| }) | |
| function listsToMd(data) { | |
| data.forEach(listToMd) | |
| } | |
| function listToMd(list) { | |
| console.log('##', list.name, '\n') | |
| list.cards.forEach(cardToMd) | |
| } | |
| function cardToMd(card) { | |
| console.log('###', card.name, '\n') | |
| if (card.desc) console.log(card.desc, '\n') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment