Changeset 679d34a in lab.git for Dev/twitter/show_status.pl
- Timestamp:
- Jan 12, 2011 8:08:41 PM (14 years ago)
- Branches:
- master, trunk
- Children:
- 17f388e
- Parents:
- 04f609d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/twitter/show_status.pl
r8333ea0 r679d34a 15 15 my $bot = Net::Twitter::Lite->new; 16 16 17 my $dump; 18 if (defined $ARGV[0] and $ARGV[0] eq "-d") { 19 $dump = shift @ARGV; 20 } 21 17 22 eval { 18 23 foreach my $id (@ARGV) { 24 $id =~ /\/?(\d+)$/; 25 $id = $1; 19 26 my $res = $bot->show_status($id); 20 27 foreach my $line (split /\n/, Dumper $res) { 21 28 if ($line =~ /undef/) { next; } 22 unless ($line =~ / => {/ 23 || $line =~ / = / 24 || $line =~ /status/ 25 || $line =~ /'text'/ 26 || $line =~ /created/ 27 || $line =~ /'id'/ 28 || $line =~ /name/ 29 || $line =~ / },/ 30 || $line =~ / };/ 31 ) { next; } 29 if (! $dump) { 30 unless ($line =~ / => {/ 31 || $line =~ / = / 32 || $line =~ /status/ 33 || $line =~ /'text'/ 34 || $line =~ /created/ 35 || $line =~ /'id'/ 36 || $line =~ /name/ 37 || $line =~ / },/ 38 || $line =~ / };/ 39 ) { next; } 40 } 32 41 print $line, "\n"; 33 42 } … … 37 46 evalrescue($@); 38 47 } 39 print "truncated output done\n";40 48 41 49
Note: See TracChangeset
for help on using the changeset viewer.