aboutsummaryrefslogtreecommitdiffstats
path: root/random.pl
blob: 92cf16806287c78b1c21c479912db8b86666efd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;
use warnings;
use IO::Socket;

my @nicks = qw(jett Bardha Endrita Mirja Omla);

while (1) {
  my $nick = $nicks[rand @nicks];
  my $socket = new IO::Socket::INET (
    PeerAddr => 'irc.shoqni.net',
    PeerPort => 6667,
    Proto => 'tcp',
  );
  
  if ($socket) {
    print $socket "NICK $nick\r\n";
    print $socket "USER $nick 0 * :Vizitor nga Shoqni.com\r\n";
    

    while (my $input = <$socket>) {
      print $input;
      print $socket "JOIN #chat\r\n";
      if ($input =~ /^PING(.*)$/i) {
        print $socket "PONG $1\r\n";
	}
    }

    close $socket;
  }

  sleep 20 * 60;
}