use LJ::Simple; ##### Get the twitter from the command-line: my $TWITTER = "@ARGV"; ##### FOR MARRIED COUPLES: Set %USERNAME to your username -- Is this the husband or the wife? my $username = $ENV{"username"}; my $user; my $pass; if ($username =~ /^HUSBAND_USER_NAME$/i) { $user = "HUSBAND_USER_NAME"; $pass = "HUSBAND_PASSWORD"; #could get these from mtsend.ini... } elsif ($username =~ /^WIFE_USER_NAME$/i) { $user = "WIFE_USER_NAME"; $pass = "WIFE_PASSWORD"; #could get these from mtsend.ini... } else { die ("FATAL ERROR: This script needs to be updated with the LJ username and password for $username"); } ##### Generate a subject line which is the first 4 words of the twitter followed by "..." -- This just read a LOT better: $TWITTERSUBJECT = $TWITTER; if ($TWITTERSUBJECT =~ /\s.*?\s.*?\s.*?\s/) { $TWITTERSUBJECT =~ s/^(.*?\s.*?\s.*?\s.*?\s).*$/$1/; $TWITTERSUBJECT =~ s/[:;\- ]$//g; $TWITTERSUBJECT .= "..."; } ##### Send the twitter. If %MOOD or %MUSIC is set prior to this script, they are included in the post automatically: print "\n\nSending twitter of \"$TWITTER\" to LiveJournal."; LJ::Simple::QuickPost ( user => $user, pass => $pass, entry => $TWITTER . "
\n", subject => $TWITTERSUBJECT, mood => $ENV{"MOOD"}, music => $ENV{"MUSIC"}, tags => ["micro-blogging","twitter"], #html => HTML content ? #protect => Security settings of the entry #groups => Friends groups list #results => Hash to store results in ) || die "$0: Failed to post entry: $LJ::Simple::error\n";