Changeset fe75883 in lab.git for Dev/twitter/dump_timeline.pl
- Timestamp:
- Dec 19, 2010 12:11:03 AM (14 years ago)
- Branches:
- master, trunk
- Children:
- 294a3aa
- Parents:
- f1b126a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/twitter/dump_timeline.pl
rf1b126a rfe75883 16 16 use Encode; 17 17 18 if ($ARGV[0] && ($ARGV[0] eq '--help' || $ARGV[0] eq '-h') ){18 my $help = sub { 19 19 die <<EOM; 20 20 usage: $0 … … 27 27 ] 28 28 EOM 29 }; 30 if ($ARGV[0] && ($ARGV[0] eq '--help' || $ARGV[0] eq '-h') ) { 31 &{$help}; 29 32 } 33 30 34 my $method = $ARGV[0] || 'user_timeline'; 31 35 my $screen_name = $ARGV[1] || ''; … … 38 42 my $conf = loadconf("$Bin/config.yml"); 39 43 if (! defined $conf) { 40 die "$0: cannot parse config file. \n";44 die "$0: cannot parse config file."; 41 45 } 42 46 43 47 my $bot = login($conf); 44 48 if (! $bot->authorized) { 45 die "$0: this client is not yet authorized. \n";49 die "$0: this client is not yet authorized."; 46 50 } 47 51 … … 68 72 } 69 73 else { 70 die "$0: unknown method => $method\n"; 74 warn "$0: unknown method '$method'"; 75 &{$help}; 71 76 } 72 77 … … 93 98 evalrescue($@); 94 99 } 95 print "done\n";96 100 97 101 … … 106 110 107 111 if ($!) { 108 warn "$0: '$file' $! \n";112 warn "$0: '$file' $!"; 109 113 } 110 114
Note: See TracChangeset
for help on using the changeset viewer.