Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.69 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. package WTPABot;
  4. use base 'Bot::BasicBot';
  5.  
  6. use Net::Twitter;
  7.  
  8. my $t = Net::Twitter->new(
  9.         traits => [qw/API::REST/],
  10.         username => "theparty",
  11.         password => "password",
  12.         clientname => "jQuery Bot 0.1"
  13. );
  14.  
  15. sub topic {
  16.         my $self = shift;
  17.         my $msg = shift;
  18.  
  19.         if ( $msg->{topic} ne "" ) {
  20.                 $t->update( $msg->{topic} );
  21.                 print STDERR "TOPIC: " . $msg->{topic} . "\n";
  22.         }
  23. }
  24.  
  25. package main;
  26.  
  27. my $bot = WTPABot->new(
  28.         server => "irc.easymac.org",
  29.         channels => ["#really"],
  30.         nick => "wtpa",
  31.         username => "wtpa",
  32.         name => "Party Time"
  33. );
  34.  
  35. $bot->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement