• Publicidad

FindIcons 0.1

¿Estás desarrollando un proyecto, o piensas hacerlo? Pon aquí tu propuesta, lo más seguro es que alguien esté interesado en ayudarte.

FindIcons 0.1

Notapor BigBear » 2012-11-25 17:25 @767

Un simple script para bajar los iconos que quieran. Los iconos bajados se guardan en un carpeta con el nombre buscado.

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. #!usr/bin/perl
  2. #FindIcons 0.1
  3. #Coded By Doddy H
  4.  
  5. use LWP::UserAgent;
  6. use URI::Split qw(uri_split);
  7. use Time::HiRes "usleep";
  8.  
  9. my $nave = LWP::UserAgent->new;
  10. $nave->agent(
  11. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  12. );
  13. $nave->timeout(5);
  14.  
  15. head();
  16.  
  17. print "[?] Search : ";
  18. chomp( my $se = <stdin> );
  19.  
  20. $se =~ s/ /-/;
  21.  
  22. my $code = toma( "http://findicons.com/search/" . $se );
  23.  
  24. if ( $code =~ /<div class="box_info left">(.*)<\/div>/ ) {
  25.     print "\n[+] $1\n";
  26.  
  27.     unless ( -d $se ) {
  28.         mkdir( $se, "777" );
  29.     }
  30.  
  31.     chdir $se;
  32.  
  33. }
  34. else {
  35.     print "\n[-] Not Found\n";
  36.     copyright();
  37. }
  38.  
  39. print "\n[?] Pages : ";
  40.  
  41. chomp( my $pages = <stdin> );
  42.  
  43. print "\n[+] Downloading ...\n\n";
  44.  
  45. for my $pages ( 1 .. $pages ) {
  46.  
  47.     my $code = toma("http://findicons.com/search/$se/$pages");
  48.  
  49.     while ( $code =~
  50.         /<img src="http:\/\/png-(.*).findicons.com\/files\/(.*)" alt/mig )
  51.     {
  52.         my $link = "http://png-" . $1 . ".findicons.com/files/" . $2;
  53.  
  54.         now($link);
  55.  
  56.     }
  57.  
  58. }
  59.  
  60. print "[+] Finished ...\n";
  61.  
  62. copyright();
  63.  
  64. sub head {
  65.  
  66.     my @logo = (
  67.         "#=============================================#", "\n",
  68.         "#              FindIcons 0.1                  #", "\n",
  69.         "#---------------------------------------------#", "\n",
  70.         "# Written By Doddy H                          #", "\n",
  71.         "# Email: lepuke[at]hotmail[com]               #", "\n",
  72.         "# Website: doddyhackman.webcindario.com       #", "\n",
  73.         "#---------------------------------------------#", "\n",
  74.         "# The End ?                                   #", "\n",
  75.         "#=============================================#", "\n"
  76.     );
  77.  
  78.     print "\n";
  79.  
  80.     marquesina(@logo);
  81.  
  82.     print "\n\n";
  83.  
  84. }
  85.  
  86. sub copyright {
  87.  
  88.     my @fin = ("-- == (C) Doddy Hackman 2012 == --");
  89.  
  90.     print "\n\n";
  91.     marquesina(@fin);
  92.     print "\n\n";
  93.  
  94.     <stdin>;
  95.  
  96.     exit(1);
  97.  
  98. }
  99.  
  100. sub marquesina {
  101.  
  102.     #Effect based in the exploits by Jafer Al Zidjali
  103.  
  104.     my @logo = @_;
  105.  
  106.     my $car = "|";
  107.  
  108.     for my $uno (@logo) {
  109.         for my $dos ( split //, $uno ) {
  110.  
  111.             $|++;
  112.  
  113.             if ( $car eq "|" ) {
  114.                 mostrar( "\b" . $dos . $car, "/" );
  115.             }
  116.             elsif ( $car eq "/" ) {
  117.                 mostrar( "\b" . $dos . $car, "-" );
  118.             }
  119.             elsif ( $car eq "-" ) {
  120.                 mostrar( "\b" . $dos . $car, "\\" );
  121.             }
  122.             else {
  123.                 mostrar( "\b" . $dos . $car, "|" );
  124.             }
  125.             usleep(40_000);
  126.         }
  127.         print "\b ";
  128.     }
  129.  
  130.     sub mostrar {
  131.         print $_[0];
  132.         $car = $_[1];
  133.     }
  134.  
  135. }
  136.  
  137. sub now {
  138.  
  139.     my ( $scheme, $auth, $path, $query, $frag ) = uri_split( $_[0] );
  140.  
  141.     if ( $path =~ /(.*)\/(.*)$/ ) {
  142.         my $file = $2;
  143.         if ( download( $_[0], $file ) ) {
  144.         }
  145.     }
  146. }
  147.  
  148. sub download {
  149.     if ( $nave->mirror( $_[0], $_[1] ) ) {
  150.         if ( -f $_[1] ) {
  151.             return true;
  152.         }
  153.     }
  154. }
  155.  
  156. sub toma {
  157.     return $nave->get( $_[0] )->content;
  158. }
  159.  
  160. #The End ?
  161.  
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4
BigBear
Perlero frecuente
Perlero frecuente
 
Mensajes: 981
Registrado: 2009-03-01 18:39 @818

Publicidad

Volver a Proyectos

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 3 invitados

cron