view gaim2blt.pl @ 7297:ceda503e55a6

[gaim-migrate @ 7881] This is AIM Alerts and Reminders (alerts.aol.com). I think this is kinda a cool thing. And it was totally easy to do. Unfortunately, though, it seems that AOL won't give your browser the alert unless you send an X-Aim header in your HTML request. I could parse the HTML myself, but it has, like forms and stuff in it... and some alerts have images... it wouldn't be worth it. So this just prints stuff to the debug window. Maybe someday someone will be able to do something with it. Mark's going to make sure I didn't screw anything up. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 18 Oct 2003 03:34:14 +0000
parents 66bf7ecefedd
children
line wrap: on
line source

#!/usr/bin/perl -w
# Original by Andy Harrison,
# Rewrite by Decklin Foster,
# Available under the GPL.

package Gaim2Blt;
use strict;
use Getopt::Std;
use vars qw(%opts $in_group);

getopts('s:', \%opts);
die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};

print <<"EOF";
Config {
  version 1
}
User {
  screenname "$opts{s}"
}
Buddy {
  list {
EOF

while (<>) {
    chomp;
    my ($type, $args) = split ' ', $_, 2;
    next unless $type;

    if ($type eq 'g') {
        print "    }\n" if ($in_group);
        print qq(    "$args" {\n);
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF