Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

MassPriceCheck

By: KiteX3 on Jan 13th, 2014  |  syntax: Bash  |  size: 0.61 KB  |  views: 66  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. curl -s 'http://magic.tcgplayer.com/magic_price_guides.asp' | grep -o '/db/price_guide.asp?setname=[a-zA-Z0-9'\''() ,.-]*' | sed 's/ /%20/g' | shuf > urlendings
  4. rm setnames ; touch setnames
  5.  
  6. for i in $(seq 1 $(wc -l urlendings | awk '{print $1}'))
  7. do
  8.         seturl="magic.tcgplayer.com$(head -n $i urlendings | tail -n 1)"
  9.         setname=$(head -n $i urlendings | tail -n 1 | grep -o 'setname=[0-9a-zA-Z'\''% ()-]*' | sed 's/^setname=//g' )
  10.         echo $setname >> setnames
  11.         wget -q "$seturl" -O junk/$setname
  12. done
  13.  
  14. for i in $(cat setnames)
  15. do
  16.         echo $(./PriceCheck -s junk/$i) $(echo $i | sed 's/%20/ /g')
  17. done