Skip to content

Instantly share code, notes, and snippets.

@funasoul
Created November 30, 2012 08:04
Show Gist options
  • Save funasoul/4174436 to your computer and use it in GitHub Desktop.
Save funasoul/4174436 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Net::Twitter::Lite;
use WWW::Mechanize;
use utf8;
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";
my $after;
print "Type your tweet: ";
my $input = <STDIN>;
chomp($input);
# Nomurish
my $mech = new WWW::Mechanize( autocheck => 1 );
$mech->get('http://racing-lagoon.info/nomu/translate.php');
$mech->form_name('f1');
$mech->field('before', $input);
$mech->field('level', 2);
$mech->click();
if ($mech->success()) {
$after = $mech->value('after');
print "$after\n";
}
# Tweet
my $nt = Net::Twitter::Lite->new(
consumer_key => 'Your consumer key',
consumer_secret => 'Your consumer secret',
access_token => 'Your access token',
access_token_secret => 'Your access token secret'
);
# Comment in to Tweet.
#my $result = eval { $nt->update($after) };
#warn "$@\n" if $@;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment