Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 1 Abril 2012, 03:20 am



Título: [Perl Tk] Whois Client 0.2
Publicado por: BigBear en 1 Abril 2012, 03:20 am
La version mejorada de un cliente whois que hice hace un largooooooooo tiempo.

Para usarlo tienen que instalar el modulo necesario de la siguiente manera.

Código:
ppm install http://www.bribes.org/perl/ppm/Net-Whois-Raw.ppd

Una imagen del programa

(http://doddyhackman.webcindario.com/images/whoisit.jpg)

El codigo es

Código
  1. #!usr/bin/perl
  2. #Whois Client 0.2
  3. #Coded By Doddy H
  4. #ppm install http://www.bribes.org/perl/ppm/Net-Whois-Raw.ppd
  5.  
  6. use Tk;
  7. use Tk::ROText;
  8. use Net::Whois::Raw;
  9.  
  10. #if ( $^O eq 'MSWin32' ) {
  11. #    use Win32::Console;
  12. #   Win32::Console::Free();
  13. #}
  14.  
  15. my $color_fondo = "black";
  16. my $color_texto = "cyan";
  17.  
  18. $yu =
  19.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  20. $yu->title("Whois Client 0.2 || Coded By Doddy H");
  21. $yu->geometry("400x350+20+20");
  22. $yu->resizable( 0, 0 );
  23.  
  24. $yu->Label(
  25.    -text       => "Page : ",
  26.    -font       => "Impact",
  27.    -background => $color_fondo,
  28.    -foreground => $color_texto
  29. )->place( -x => 20, -y => 20 );
  30. my $targe = $yu->Entry(
  31.    -width      => 35,
  32.    -background => $color_fondo,
  33.    -foreground => $color_texto
  34. )->place( -x => 70, -y => 26 );
  35. $yu->Button(
  36.    -text             => "Get Info",
  37.    -width            => 10,
  38.    -background       => $color_fondo,
  39.    -foreground       => $color_texto,
  40.    -activebackground => $color_texto,
  41.    -command          => \&whoisit
  42. )->place( -x => 290, -y => 24 );
  43. $yu->Label(
  44.    -text       => "Information",
  45.    -font       => "Impact",
  46.    -background => $color_fondo,
  47.    -foreground => $color_texto
  48. )->place( -x => 140, -y => 85 );
  49. my $data = $yu->Scrolled(
  50.    "ROText",
  51.    -width      => 40,
  52.    -height     => 12,
  53.    -scrollbars => "e",
  54.    -background => $color_fondo,
  55.    -foreground => $color_texto
  56. )->place( -x => 45, -y => 150 );
  57.  
  58. sub whoisit {
  59.  
  60.    $data->delete( "0.1", "end" );
  61.    $data->insert( "end", whois( $targe->get ) );
  62.  
  63. }
  64.  
  65. MainLoop;
  66.  
  67. #The End ?
  68.