Skip to content

Instantly share code, notes, and snippets.

@jgv
Created June 8, 2012 17:34
Show Gist options
  • Save jgv/2897099 to your computer and use it in GitHub Desktop.
Save jgv/2897099 to your computer and use it in GitHub Desktop.
automemebot
#/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