Created
June 24, 2014 19:49
-
-
Save matoken/9c16d8877340819b0e99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Encode; | |
use Email::MIME; | |
use Email::MIME::ContentType; | |
use LWP::Simple; | |
my $ROOM = 'kagolug'; | |
my $BOT_NAME = 'KagolugML_bot'; | |
my $BOT_VERIFIER = 'b3c03556dca8dfffb8c509cb709817044c98ad87'; | |
my $mail=''; | |
while(my $line=<STDIN>){ | |
$mail .= $line; | |
} | |
my $parsed = Email::MIME->new($mail); | |
my $Subject = encode( 'utf8', $parsed->header('Subject') ) . "\n"; | |
my $url = "http://lingr.com/api/room/say?room=$ROOM&bot=$BOT_NAME&text=$Subject&bot_verifier=$BOT_VERIFIER"; | |
print get("$url"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment