Skip to content

Instantly share code, notes, and snippets.

@IamCarbonMan
Created January 13, 2019 08:40
Show Gist options
  • Save IamCarbonMan/444ec11b1c19fcd30bd63bc2d0fb1803 to your computer and use it in GitHub Desktop.
Save IamCarbonMan/444ec11b1c19fcd30bd63bc2d0fb1803 to your computer and use it in GitHub Desktop.
use scryfall's API to create your very own Tower of Power
scryfall = require('scryfall-client')
scry = new scryfall()
Promise.all([
scry.get('cards/search', {q:'c=w -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 50)),
scry.get('cards/search', {q:'c=u -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 50)),
scry.get('cards/search', {q:'c=b -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 50)),
scry.get('cards/search', {q:'c=r -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 50)),
scry.get('cards/search', {q:'c=g -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 50)),
scry.get('cards/search', {q:'c=m -t:land -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 70)),
scry.get('cards/search', {q:'c=c -t:land -o:"{T}: Add" -o:search usd<0.5 order:edhrec'}).then(res => res.slice(0, 30)),
]).then(res => console.log([].concat.apply([], res).map(card => card.name).join('\n')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment