Skip to content
Extraits de code Groupes Projets
Valider f64eb142 rédigé par Alexandre Morignot's avatar Alexandre Morignot
Parcourir les fichiers

we put all in msg

parent 31629933
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -37,6 +37,6 @@ sub on_start { ...@@ -37,6 +37,6 @@ sub on_start {
print "$json\n"; print "$json\n";
# TODO: handle $content->{'msg'} # TODO: handle $content->{'msg'}
$kernel->post('IKC', 'post', 'poe://PlayBot/fbrecv/fbmsg', [ $content->{'author'}, $content->{'link'} ]); $kernel->post('IKC', 'post', 'poe://PlayBot/fbrecv/fbmsg', [ $content->{'author'}, $content->{'msg'} ]);
$kernel->post('IKC', 'shutdown'); $kernel->post('IKC', 'shutdown');
} }
...@@ -31,16 +31,15 @@ sub get_content { ...@@ -31,16 +31,15 @@ sub get_content {
open (my $fh, "<", $file); open (my $fh, "<", $file);
$content{'msg'} = ''; $content{'msg'} = '';
$content{'link'} = '';
while (<$fh>) { while (<$fh>) {
if (/^(.*) posted in NightIIEs/) { if (/^(.*) posted in NightIIEs/) {
$content{'author'} = $1; $content{'author'} = $1;
} elsif (/^https:\/\/l.facebook.com\/l\/.*\/(.*)/) { } elsif (/^https:\/\/l.facebook.com\/l\/.*\/(.*)/) {
$content{'link'} .= ' '.$uri->decode($1); $content{'msg'} .= ' '.$uri->decode($1);
} elsif (/#/) { } elsif (/#/) {
chomp; chomp;
$content{'msg'} .= $_; $content{'msg'} .= ' '.$_;
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter