September 19th, 2013

How to look up Magic Card prices from the command line....

Yep... I'm a geek



Mac-Pro-2:cards ballison$ export CARD="congregate"
Mac-Pro-2:cards ballison$ curl --silent http://magic.tcgplayer.com/db/magic_single_card.asp?cn="$CARD" | grep -A5 "class=default_8>H:</td>" | grep "^<B>" |egrep -o "[0-9]?,?.[0-9]*\.[0-9]*"
$1.05
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$ export CARD="terminate"
Mac-Pro-2:cards ballison$ curl --silent http://magic.tcgplayer.com/db/magic_single_card.asp?cn="$CARD" | grep -A5 "class=default_8>H:</td>" | grep "^<B>" |egrep -o "[0-9]?,?.[0-9]*\.[0-9]*"
$2.05
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$ export CARD="Black%20Lotus"
Mac-Pro-2:cards ballison$ curl --silent http://magic.tcgplayer.com/db/magic_single_card.asp?cn="$CARD" | grep -A5 "class=default_8>H:</td>" | grep "^<B>" |egrep -o "[0-9]?,?.[0-9]*\.[0-9]*"
1,599.95
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$
Mac-Pro-2:cards ballison$ export CARD="Polukranos%2C%20World%20Eater"
Mac-Pro-2:cards ballison$ curl --silent http://magic.tcgplayer.com/db/magic_single_card.asp?cn="$CARD" | grep -A5 "class=default_8>H:</td>" | grep "^<B>" |egrep -o "[0-9]?,?.[0-9]*\.[0-9]*"
$7.99