Created
January 11, 2010 03:46
-
-
Save nekoya/273984 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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