Permalink
Browse files

Just some code cleanup in preparation for more features to be added.

  • Loading branch information...
1 parent 0db1f4a commit e01c9df7dd53b0f6c09347f7965068debac7c7c6 Ben Cotton committed Jun 26, 2011
Showing with 17 additions and 17 deletions.
  1. +17 −17 mmtter
View
34 mmtter
@@ -31,33 +31,33 @@ my $TTYTTERRC = "";
# not how you intended
my $DELAY = 5;
unless ( $TTYTTERRC eq "" ) {
- $TTYTTER = "$TTYTTER -rc=$TTYTTERRC";
+ $TTYTTER = "$TTYTTER -rc=$TTYTTERRC";
}
# What's the stuff to append?
-my $append = '(#mariomarathon live at http://ustre.am/VS3)';
+my $APPEND = '(#mariomarathon live at http://ustre.am/VS3)';
# Build the string or prompt for it if there's nothing there.
my $tweet = '';
if ( @ARGV > 0 ) {
- foreach ( @ARGV ) {
- $tweet = $tweet . "$_ ";
- }
+ foreach ( @ARGV ) {
+ $tweet = $tweet . "$_ ";
+ }
} else {
- print "What do you want to say? ";
- chomp($tweet = <>);
- # Append a space for the sake of readability
- $tweet .= ' ';
+ print "What do you want to say? ";
+ chomp($tweet = <>);
+ # Append a space for the sake of readability
+ $tweet .= ' ';
}
# Check to make sure we don't exceed 140 characters and then send the message
-if ( ( length($tweet) ) < ( 140 - length($append) ) ) {
- $tweet = $tweet . $append;
- print "\nSending $tweet \n";
- sleep $DELAY;
- open (OUTPUT, "| $TTYTTER -status=- ") or die "Couldn't pipe it to $TTYTTER\n";
- print OUTPUT "$tweet" or die "Something went horribly wrong!\n";
- close (OUTPUT);
+if ( ( length($tweet) ) < ( 140 - length($APPEND) ) ) {
+ $tweet = $tweet . $APPEND;
+ print "\nSending $tweet \n";
+ sleep $DELAY;
+ open (OUTPUT, "| $TTYTTER -status=- ") or die "Couldn't pipe it to $TTYTTER\n";
+ print OUTPUT "$tweet" or die "Something went horribly wrong!\n";
+ close (OUTPUT);
} else {
- print "Your tweet is too long. (That's what she said!)\n";
+ print "Your tweet is too long. (That's what she said!)\n";
}

0 comments on commit e01c9df

Please sign in to comment.