view gaim2blt.pl @ 9222:316b1afb5974

[gaim-migrate @ 10018] nosnilmot make autolinkification work even better. This patch improves the way we auto-linkify detected URLs and email addresses: - if a URL is enclosed in parenthesis eg (http://www.google.com/), the closing parenthesis will not be included as part of the link - email addresses inside parenthesis or <>'s will correctly be linked - either whitespace or non-ascii characters are recognized as boundaries for email addresses, which will allow auto linking of email addresses for Chinese conversations which don't use whitespace: <stu|laptop> wing: you know you mentioned being able to auto-linkify email addresses in Chinese text (without whitespace), do you want to try a patch out for me? <wing> stu|laptop: eh, actually i found that gaim cannot <stu|laptop> cannot? at all? <wing> stu|laptop: it seems so stu|laptop> even with this? <link to patch> <wing> stu|laptop: i'll check it out then :) ... ... <wing> stu|laptop: it works perfectly with the patch :) committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 06 Jun 2004 19:06:22 +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