Changeset 161

Show
Ignore:
Timestamp:
07/19/10 14:03:33 (7 weeks ago)
Author:
mike
Message:

change source order for Define, add config option 'sourcelist' for it

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/conf/whatbot.conf-example

    r155 r161  
    2727        <commands> 
    2828            <admin user="adminuser" /> 
     29            <define sourcelist="urbandictionary google wikipedia" /> 
    2930        </commands> 
    3031        <log directory="/var/log/whatbot" /> 
  • trunk/lib/whatbot/Command/Define.pm

    r160 r161  
    9494    $def =~ s/ ,/,/g; 
    9595 
    96     return $def . " (U)"; 
     96    return $def . " (UD)"; 
    9797} 
    9898 
     
    112112    $def =~ s/ ,/,/g; 
    113113 
    114     return $def . " (G)"; 
     114    return $def . " (GG)"; 
    115115} 
    116116 
     
    169169    $def =~ s/\(help·info\)//g; 
    170170 
    171     $def =~ s/\[citation needed\]//g; # this makes me want to stab people, just for the record 
    172  
    173     return $def . " (W)"; 
     171    $def =~ s/\[[^\]]+\]//g; 
     172 
     173    return $def . " (WP)"; 
    174174} 
    175175 
     
    205205    my ( $self, $phrase ) = @_; 
    206206 
    207     my @default_sources = qw( wikipedia urbandictionary google ); 
     207    my @default_sources; 
     208    if (!exists($self->my_config->{sourcelist})) { 
     209        @default_sources = qw(urbandictionary google wikipedia); 
     210    } 
     211    else { 
     212        @default_sources = split / /, $self->my_config->{sourcelist}; 
     213    } 
     214 
    208215    my @sources; 
    209216    $_ = $phrase;