my $bot = Net::Twitter::Lite->new;
+my $dump;
+if (defined $ARGV[0] and $ARGV[0] eq "-d") {
+ $dump = shift @ARGV;
+}
+
eval {
foreach my $id (@ARGV) {
+ $id =~ /\/?(\d+)$/;
+ $id = $1;
my $res = $bot->show_status($id);
foreach my $line (split /\n/, Dumper $res) {
if ($line =~ /undef/) { next; }
- unless ($line =~ / => {/
- || $line =~ / = /
- || $line =~ /status/
- || $line =~ /'text'/
- || $line =~ /created/
- || $line =~ /'id'/
- || $line =~ /name/
- || $line =~ / },/
- || $line =~ / };/
- ) { next; }
+ if (! $dump) {
+ unless ($line =~ / => {/
+ || $line =~ / = /
+ || $line =~ /status/
+ || $line =~ /'text'/
+ || $line =~ /created/
+ || $line =~ /'id'/
+ || $line =~ /name/
+ || $line =~ / },/
+ || $line =~ / };/
+ ) { next; }
+ }
print $line, "\n";
}
}
if ($@) {
evalrescue($@);
}
-print "truncated output done\n";
sub evalrescue {