Advertisement
BhieNEka

twitter.pl

Apr 1st, 2013
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.89 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use IO::Socket;
  3. use IO::Select;
  4. use Socket;
  5. @pesan = (
  6. "Twitter%20Bot",
  7. "http://bhieneka.blogspot.com%20emang%20keren",
  8. );
  9.  
  10. $len = @pesan;
  11. my $status = @pesan[int rand($len)];
  12. my $url1 = ("http://URL_DOMAINMU/twitter.php?stat=$status");
  13. my $stat1 = query($url1);
  14.  
  15. sub query($) {
  16.     my $url = $_[0];
  17.     $url =~ s/http:\/\///;
  18.     my $host  = $url;
  19.     my $query = $url;
  20.     my $page  = "";
  21.     $host  =~ s/href=\"?http:\/\///;
  22.     $host  =~ s/([-a-zA-Z0-9\.]+)\/.*/$1/;
  23.     $query =~ s/$host//;
  24.     if ( $query eq "" ) { $query = "/"; }
  25.     eval {
  26.         my $sock = IO::Socket::INET->new(PeerAddr => "$host", PeerPort => "80", Proto => "tcp") or return;
  27.         print $sock "GET $query HTTP/1.0\r\nHost: $host\r\nAccept: */*\r\nUser-Agent: Mozilla/5.0\r\n\r\n";
  28.         my @r = <$sock>;
  29.         $page = "@r";
  30.         close($sock);
  31.     };
  32.     return $page;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement