Skip to content

Instantly share code, notes, and snippets.

@smiler
Created November 22, 2011 09:48
Show Gist options
  • Select an option

  • Save smiler/1385321 to your computer and use it in GitHub Desktop.

Select an option

Save smiler/1385321 to your computer and use it in GitHub Desktop.
# Who smiles the most?
my $e = '[8;:=%]'; # eyes
my $n = '[-oc*^]'; # nose
# smileys including asian-style (^^ ^_^' ^^; \o/)
if ($saying =~ /(>?$e'?$n[\)pPD\}\]>]|[\(\{\[<]$n'?$e<?|[;:][\)pPD\}\]\>]|\([;:]|\^[_o-]*\^[';]|\\[o.]\/)/o) {
$stats->{smiles}{$nick}++;
$stats->{smileys}{$1}++;
$stats->{smileynicks}{$1} = $nick;
}
# asian frown: ;_;
if ($saying =~ /($e'?$n[\(\[\\\/\{|]|[\)\]\\\/\}|]$n'?$e|[;:][\(\/]|[\)D]:|;_+;|T_+T|-[._]+-)/o and
$saying !~ /\w+:\/\//o) {
$stats->{frowns}{$nick}++;
$stats->{smileys}{$1}++;
$stats->{smileynicks}{$1} = $nick;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment