Skip to content

Instantly share code, notes, and snippets.

@RichardLitt
Created November 19, 2015 15:49
Show Gist options
  • Select an option

  • Save RichardLitt/f7badc7eac0080ad9ee4 to your computer and use it in GitHub Desktop.

Select an option

Save RichardLitt/f7badc7eac0080ad9ee4 to your computer and use it in GitHub Desktop.
/* 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