Skip to content

Commit

Permalink
Ajout de la récup de liens random / last
Browse files Browse the repository at this point in the history
  • Loading branch information
matael committed Dec 16, 2012
1 parent 7c51b83 commit 00208fe
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions teuse.pl
Expand Up @@ -266,6 +266,28 @@ sub said {
channel => $a->{channel},
body => $msg
);
elsif ($1 =~ /([^\s]*)\s*$/) {
if ($1 eq 'random') {
my $lk = LWP::Simple::get("http://links.matael.org/api/random");
$self->say(
who => $a->{who},
channel => $a->{channel},
body => $lk
);
} elsif ($1 eq 'last') {
my $lk = LWP::Simple::get("http://links.matael.org/api/api");
$self->say(
who => $a->{who},
channel => $a->{channel},
body => $lk
);
} else {
$self->say(
who => $a->{who},
channel => $a->{channel},
body => "Désolé, ça ne me dit rien."
);
}
} else {
$self->say(
who => $a->{who},
Expand All @@ -276,6 +298,10 @@ sub said {
channel => $a->{channel},
body => "!link URL [titre]"
);
$self->say(
channel => $a->{channel},
body => "pour la liste des liens : http://links.matael.org"
);
}
}
# }}}
Expand Down

0 comments on commit 00208fe

Please sign in to comment.