daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Mar 17th, 2018 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. use Encode;
  6. use Net::Twitter;
  7. use Net::Wassr;
  8.  
  9. my $username = 'nekoya';
  10. my $filename = 'tmp';
  11.  
  12. open my $fh, '<', $filename or die "message file open failed.";
  13. my $msg = Encode::decode('utf-8', join('', <$fh>));
  14. close $fh or die "file close error.";
  15.  
  16. my $pwd = sub {
  17.     my $site = shift;
  18.     my $pwd = `~/mkpasswd.pl $site`;
  19.     chomp $pwd;
  20.     $pwd;
  21. };
  22.  
  23. my $tw = Net::Twitter->new(
  24.     username => $username,
  25.     password => $pwd->( 'twitter' ),
  26. );
  27. $tw->update( Encode::encode('utf-8',$msg) );
  28.  
  29. my $wassr = Net::Wassr->new(
  30.     user   => $username,
  31.     passwd => $pwd->( 'wassr' ),
  32. );
  33. $wassr->_get(
  34.     '/update.json',
  35.     {
  36.         source => 'Net::Wassr',
  37.         status => $msg,
  38.     }
  39. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top