Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: BigBear en 1 Diciembre 2011, 22:08 pm



Título: [Perl Tk] GoogleHack 0.3
Publicado por: BigBear en 1 Diciembre 2011, 22:08 pm
Simple programa en tk para buscar en google


Código
  1. #!usr/bin/perl
  2. #GoogleHack 0.3
  3. #By Doddy H
  4. #Based in the program GoogleHacks
  5. use Tk;
  6. use Tk::PNG;
  7.  
  8. if ($^O eq 'MSWin32') {
  9. use Win32::Console;
  10. Win32::Console::Free();
  11. }
  12.  
  13. my $ventana = MainWindow->new();
  14. $ventana->title("GoogleHack 0.3 By Doddy H");
  15. $ventana->geometry("370x300+20+20");
  16. $ventana->resizable(0,0);
  17.  
  18. $ventana->Label(-font=>"Impact1",-text=>"String : ")->place(-x=>20,-y=>20);
  19. my $v = $ventana->Entry(-text=>"Test",-width=>"31")->place(-x=>80,-y=>23);
  20. $ventana->Button(-width=>"10",-text=>"Load",-command=>\&now)->place(-x=>278,-y=>23);
  21.  
  22. $ventana->Label(-text=>"Options",-font=>"Impact1")->place(-x=>140,-y=>70);
  23.  
  24. $ventana->Radiobutton(-text =>"Music", -value => "music",-variable=> \$op)->place(-x=>140,-y=>130);
  25. $ventana->Radiobutton(-text =>"Programs", -value => "programs",-variable=> \$op)->place(-x=>140,-y=>160);
  26. $ventana->Radiobutton(-text =>"Book", -value => "book",-variable=> \$op)->place(-x=>140,-y=>190);
  27. $ventana->Radiobutton(-text =>"Videos", -value => "videos",-variable=> \$op)->place(-x=>140,-y=>220);
  28. $ventana->Radiobutton(-text =>"Torrent", -value => "torrent",-variable=> \$op)->place(-x=>140,-y=>250);
  29.  
  30. MainLoop;
  31.  
  32. sub now {
  33.  
  34. my $test = $v->get;
  35. my $link;
  36.  
  37. if ($op eq "music") {
  38. $link = '-inurl:(htm|html|php) intitle:index of +last modified +parent directory +description +size +(.mp3|.wma|.ogg) "'.$test.'"';
  39. }
  40. elsif ($op eq "programs") {
  41. $link = '-inurl:(htm|html|php) intitle:index of +last modified +parent directory +description +size +(.exe|.zip|.ddl) "'.$test.'"';
  42. }
  43. elsif ($op eq "book") {
  44. $link = '-inurl:(htm|html|php) intitle:index of +last modified +parent directory +description +size +(.txt|.pps|.lit|.odt|.doc|.rtf|.zip|.rar|.pdf|.chm) "'.$test.'"';
  45. }
  46. elsif ($op eq "videos") {
  47. $link = '-inurl:(htm|html|php) intitle:index of +last modified +parent directory +description +size +(.mpg|.avi|.flv|.wmv|.di) "'.$test.'"';
  48. }
  49. elsif ($op eq "torrent") {
  50. $link = "$test filetype:torrent";
  51. } else {
  52. $link = "como aprender a escribir";
  53. }
  54. chomp $link;
  55. my $final = "http://www.google.com.ar/search?q=".$link;
  56. system('start firefox "'.$final.'"');
  57. }
  58.  
  59. # The End ?
  60.