#!/usr/bin/perl use Net::Twitter; my $DEBUG=0; my $username=$ENV{"TMPUSERNAME"}; my $password=$ENV{"TMPPASSWORD"}; my $TWITTER =$ENV{"TWITTER"}; #Strip all-around quotes? No, not for now: #if (($TWITTER =~ /^"/) && ($TWITTER =~ /"$/)) { $TWITTER =~ s/^"//i; $TWITTER =~ s/"$//i; } if ($DEBUG) { print "username is $username\n"; print "password is $password\n"; print "twitter is $TWITTER\n"; } if ($username eq "") { die("Need to set environment variable: TMPUSERNAME with twitter username"); } if ($password eq "") { die("Need to set environment variable: TMPPASSWORD with twitter password"); } if ($TWITTER eq "") { die("Need to set environment variable: TWITTER with twitter content"); } my $twit = Net::Twitter->new(username=>$username, password=>$password); my $result = $twit->update($TWITTER); #shorthand versoin: #use Net::Twitter; #my $twit = Net::Twitter->new(username=>$ENV{"TMPUSERNAME"}, password=>$ENV{"TMPPASSWORD"}); #my $result = $twit->update($ENV{"TWITTER"});