Created
June 8, 2012 17:34
-
-
Save jgv/2897099 to your computer and use it in GitHub Desktop.
automemebot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/perl | |
use strict; | |
use warnings; | |
use Net::OSCAR qw(:standard); | |
use LWP::Simple; | |
use Proc::Daemon; | |
# Daemonize | |
Proc::Daemon::Init(); | |
print 'daemonizing'; | |
my $screenname = 'automeme'; | |
my $password = 'your_password'; | |
my $oscar; | |
my $meme; | |
$oscar = Net::OSCAR->new(); | |
$oscar->set_callback_im_in(\&im_in); | |
$oscar->signon($screenname, $password); | |
while(1) { | |
$oscar->do_one_loop(); | |
} | |
sub im_in { | |
my($oscar, $sender, $message) = @_; | |
$meme = get 'http://meme.boxofjunk.ws/moar.txt?lines=1'; | |
$oscar->send_im($sender, $meme); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment