Skip to content

Instantly share code, notes, and snippets.

@matoken
Created June 24, 2014 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matoken/9c16d8877340819b0e99 to your computer and use it in GitHub Desktop.
Save matoken/9c16d8877340819b0e99 to your computer and use it in GitHub Desktop.
#!/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