use urlencode to instead of sed to encode card name

master
melvinzhang 2015-03-29 17:45:09 +08:00
parent 80e2c07b67
commit 33e1d8fb45
1 changed files with 2 additions and 2 deletions

View File

@ -440,8 +440,8 @@ verify_mana_cost_order: cards/mtg_mana_costs cards/mag_mana_costs
if grep token= $^; then \
echo "ERROR: Not applicable to tokens"; \
else \
name=$$(grep name= $^ | sed 's/name=//' | sed 's/ /%20/g');\
value=$$(curl -sL http://gatherer.wizards.com/pages/card/details.aspx?name=$$name | grep "textRatingValue" | grep -o "[0-9]\.[^<]*" | head -1);\
name=$$(grep name= $^ | sed 's/name=//');\
value=$$(curl -sLG http://gatherer.wizards.com/pages/card/details.aspx --data-urlencode "name=$$name" | grep "textRatingValue" | grep -o "[0-9]\.[^<]*" | head -1);\
sed -i "s/value=.*/value=$$value/" $^;\
fi \