Created
November 19, 2015 15:49
-
-
Save RichardLitt/f7badc7eac0080ad9ee4 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
| /* Print out open cards from a given list */ | |
| function listCards (listName) { | |
| return Promise.try(function () { | |
| return getOpenLists() | |
| }).filter(function (list) { | |
| return list.name === listName | |
| }).then(function (list) { | |
| return t.getAsync('/1/lists/' + list[0].id, {cards: 'open'}) | |
| }).then(function (list) { | |
| return Promise.map(list.cards, function (card) { | |
| console.log(card.name) | |
| }) | |
| }).catch(function (err) { | |
| if (err) throw new Error('Could not find list') | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment