Advertisement
due204

miListaGUI.sh

Sep 10th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.46 KB | None | 0 0
  1. #!/bin/bash
  2. #====================================================================================
  3. #
  4. #          FILE:  miListaGUI.sh
  5. #
  6. #         USAGE:  ./miListaGUI.sh
  7. #
  8. #   DESCRIPTION:  Segunda version (pero con una GUI) de mi script para la McAnime.
  9. #
  10. #       OPTIONS:  None
  11. #  REQUIREMENTS:  Zenity
  12. #          BUGS:  None
  13. #         NOTES:  Agadecimientos a Doumekxkai por la ayuda que me dio.
  14. #        AUTHOR:  Due204
  15. #  ORGANIZATION:  ..::Due204::..
  16. #       CREATED:  07/09/12 01:12:34 ART
  17. #      REVISION:  0.1
  18. #===================================================================================
  19.  
  20. LINKP=`zenity --title="Mi Lista" --text="Ingrese el link del perfil: " --entry`
  21.  
  22. MCD=`echo "$LINKP" | cut -d '.' -f1 | cut -d ':' -f2`
  23.  
  24. if [ $MCD = "//www" ]; then
  25.     LINKP2=`echo $LINKP | cut -d '/' -f5`
  26. elif [ $MCD = "//kronos" ]; then
  27.     LINKP2=`echo $LINKP | cut -d '/' -f5`
  28. else
  29.     zenity --warning --text="Link no valido"
  30.     exit
  31. fi
  32.  
  33. LINKPA=`echo "http://kronos.mcanime.net/perfil/$LINKP2/listaanime"`
  34.  
  35. MENU=`zenity --width=240 --height=270 --title="Que desea ver?" --list\
  36.     --column=Opciones: --text "Elige una opcion"\
  37.     "Viendo" "Completadas" "Pausadas En espera" \
  38.     "Quiero ver" "Abandonadas." "Estado por definir." "Lista completa"`
  39.  
  40.  
  41. VERE=`echo $MENU | wc -m`
  42.  
  43.  
  44. if [ $VERE = "7" ]; then
  45.     LINKPAF=`curl -l $LINKPA/W`
  46.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  47.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  48.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  49.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  50.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  51.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  52.     NUMEROS=`echo "$SERIE" | wc -l`
  53.     items=( )
  54.     for i in `seq 1 $NUMEROS`
  55.     do
  56.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  57.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  58.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  59.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  60.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  61.             FAVO=`echo "Si"`
  62.         else
  63.             FAVO=`echo "No"`
  64.         fi
  65.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  66.     done
  67.  
  68. elif [ $VERE = "12" ]; then
  69.     LINKPAF=`curl -l $LINKPA/C`
  70.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  71.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  72.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  73.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  74.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  75.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  76.     NUMEROS=`echo "$SERIE" | wc -l`
  77.     items=( )
  78.     for i in `seq 1 $NUMEROS`
  79.     do
  80.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  81.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  82.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  83.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  84.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  85.             FAVO=`echo "Si"`
  86.         else
  87.             FAVO=`echo "No"`
  88.         fi
  89.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  90.     done
  91.  
  92. elif [ $VERE = "19" ]; then
  93.     LINKPAF=`curl -l $LINKPA/H`
  94.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  95.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  96.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  97.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  98.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  99.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  100.     NUMEROS=`echo "$SERIE" | wc -l`
  101.     items=( )
  102.     for i in `seq 1 $NUMEROS`
  103.     do
  104.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  105.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  106.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  107.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  108.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  109.             FAVO=`echo "Si"`
  110.         else
  111.             FAVO=`echo "No"`
  112.         fi
  113.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  114.     done
  115.  
  116. elif [ $VERE = "11" ]; then
  117.     LINKPAF=`curl -l $LINKPA/D`
  118.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  119.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  120.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  121.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  122.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  123.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  124.     NUMEROS=`echo "$SERIE" | wc -l`
  125.     items=( )
  126.     for i in `seq 1 $NUMEROS`
  127.     do
  128.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  129.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  130.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  131.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  132.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  133.             FAVO=`echo "Si"`
  134.         else
  135.             FAVO=`echo "No"`
  136.         fi
  137.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO")
  138.     done
  139.  
  140. elif [ $VERE = "13" ]; then
  141.     LINKPAF=`curl -l $LINKPA/A`
  142.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  143.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  144.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  145.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  146.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  147.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  148.     NUMEROS=`echo "$SERIE" | wc -l`
  149.     items=( )
  150.     for i in `seq 1 $NUMEROS`
  151.     do
  152.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  153.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  154.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  155.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  156.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  157.             FAVO=`echo "Si"`
  158.         else
  159.             FAVO=`echo "No"`
  160.         fi
  161.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  162.     done
  163.  
  164.  
  165. elif [ $VERE = "20" ]; then
  166.     LINKPAF=`curl -l $LINKPA/N`
  167.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  168.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  169.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  170.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  171.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  172.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  173.     NUMEROS=`echo "$SERIE" | wc -l`
  174.     items=( )
  175.     for i in `seq 1 $NUMEROS`
  176.     do
  177.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  178.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  179.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  180.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  181.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  182.             FAVO=`echo "Si"`
  183.         else
  184.             FAVO=`echo "No"`
  185.         fi
  186.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  187.     done
  188.  
  189.  
  190. elif [ $VERE = "15" ]; then
  191.     LINKPAF=`curl -l $LINKPA`
  192.     USER=`echo "$LINKPAF" | grep 'ua-arrow selected' | cut -d '>' -f3 | cut -d '<' -f1`
  193.     SERIE=`echo "$LINKPAF" | grep -i 'target' | cut -d '>' -f2 | cut -d '<' -f1 | sed 1,2d`
  194.     PUNTOS=`echo "$LINKPAF" | grep -i 'div style="width:29px;' | sed /Puntuación/d | cut -d '>' -f2 | cut -d '<' -f1`
  195.     TIP=`echo "$LINKPAF" | grep -i 'div style="width:38px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d`
  196.     PROGRESO=`echo "$LINKPAF" | grep -i 'div style="width:52px;' | cut -d '>' -f2 | cut -d '<' -f1 | sed /Tipo/d | sed /Progreso/d`
  197.     FAV=`echo "$LINKPAF" | grep -i 'div style="width:11px;' | sed /-/d | cut -d '>' -f2 | cut -d '<' -f1`
  198.     NUMEROS=`echo "$SERIE" | wc -l`
  199.     items=( )
  200.     for i in `seq 1 $NUMEROS`
  201.     do
  202.         TITULO=`echo "$SERIE" | head -$i | tail -1`
  203.         PUNTUACION=`echo "$PUNTOS" | head -$i | tail -1`
  204.         TIPO=`echo "$TIP" | sed /Tipo/d | head -$i | tail -1`
  205.         PROGRES=`echo "$PROGRESO" | head -$i | tail -1`
  206.         if [ -z `echo "$FAV" | head -$i | tail -1` ]; then
  207.             FAVO=`echo "Si"`
  208.         else
  209.             FAVO=`echo "No"`
  210.         fi
  211.     items+=( "$TITULO" "$PUNTUACION" "$TIPO" \ "$PROGRES" "$FAVO" )
  212.     done
  213.  
  214. else
  215.     exit
  216. fi
  217.  
  218.  
  219. zenity --list --title="$MENU de $USER" --column="Titulo" --column="Puntuacion" \
  220.     --column="Tipo" --column="Progreso" --column="Favorita" "${items[@]}"
  221.  
  222. # Al fin este es el fin xD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement