Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created January 11, 2010 03:46
Show Gist options
  • Select an option

  • Save nekoya/273984 to your computer and use it in GitHub Desktop.

Select an option

Save nekoya/273984 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Net::Twitter;
use Net::Wassr;
my $username = 'nekoya';
my $filename = 'tmp';
open my $fh, '<', $filename or die "message file open failed.";
my $msg = Encode::decode('utf-8', join('', <$fh>));
close $fh or die "file close error.";
my $pwd = sub {
my $site = shift;
my $pwd = `~/mkpasswd.pl $site`;
chomp $pwd;
$pwd;
};
my $tw = Net::Twitter->new(
username => $username,
password => $pwd->( 'twitter' ),
);
$tw->update( Encode::encode('utf-8',$msg) );
my $wassr = Net::Wassr->new(
user => $username,
passwd => $pwd->( 'wassr' ),
);
$wassr->_get(
'/update.json',
{
source => 'Net::Wassr',
status => $msg,
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment