downloadovátko skinů

From Anonymous, 10 Years ago, written in Bash, viewed 534 times.
URL http://minetest.wjake.com/stikked/view/0b0e7ecc Embed
Download Paste or View Raw
  1. #!/bin/bash
  2.  
  3. mkdir meta
  4.  
  5. for LINK in `cat ~/mt-skiny2.txt`; do
  6.         wget http://novask.in/$LINK.png
  7.         TITLE=`curl -L http://minecraft.novaskin.me/skin/$LINK/ 2>/dev/null | grep \<title\>|sed "s/\<title\>\([^<]*\) - NovaSkin gallery - Minecraft Skins.*/\1/"`
  8.  
  9.         if [ "$TITLE" != "    <>" ]; then
  10.                 JMENO=`echo $TITLE | sed "s/    <>//"`
  11.                 # first, strip underscores
  12.                 CLEAN=${JMENO//_/}
  13.                 # next, replace spaces with underscores
  14.                 CLEAN=${CLEAN// /_}
  15.                 # now, clean out anything that's not alphanumeric or an underscore
  16.                 CLEAN=${CLEAN//[^a-zA-Z0-9_]/}
  17.                 # finally, lowercase with TR
  18.                 CLEAN=`echo -n $CLEAN | tr A-Z a-z`
  19.                 echo "name = \"$CLEAN\"," > meta/$LINK.txt
  20.                 echo "author = \"http://minecraft.novaskin.me/skin/$LINK/\"," >> meta/$LINK.txt
  21.                 echo "description = \"\"," >> meta/$LINK.txt
  22.                 echo "comment = \"\"," >> meta/$LINK.txt
  23.                 echo "" >> meta/$LINK.txt
  24.         else
  25.                 echo "name = \"J. Doe\"," > meta/$LINK.txt
  26.                 echo "author = \"http://minecraft.novaskin.me/skin/$LINK/\"," >> meta/$LINK.txt
  27.                 echo "description = \"\"," >> meta/$LINK.txt
  28.                 echo "comment = \"\"," >> meta/$LINK.txt
  29.                 echo "" >> meta/$LINK.txt
  30.         fi
  31. done

Reply to "downloadovátko skinů"

Here you can reply to the paste above