diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-02 08:51:10 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-02 08:51:10 -0400 |
commit | 5f9a4ebef493997557ef4470268bed0e5799b6cb (patch) | |
tree | f9a06c1773e511d3273c5d9223d06ca0806d5341 /scripts/twitterstatusfetcher.php | |
parent | e52997e52fe02960908eb6a9637a3349a2c74dad (diff) | |
parent | d04ab14a5a15f9119bedca1332eb516ecf5ca483 (diff) |
Merge branch '0.8.x' into queuemanager
Diffstat (limited to 'scripts/twitterstatusfetcher.php')
-rwxr-xr-x | scripts/twitterstatusfetcher.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 5ffdda58f..8b10bfbad 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -25,9 +25,14 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('MAXCHILDREN', 2); define('POLL_INTERVAL', 60); // in seconds +$shortoptions = 'i::'; +$longoptions = array('id::'); + $helptext = <<<END_OF_TRIM_HELP Batch script for retrieving Twitter messages from foreign service. + -i --id Identity (default 'generic') + END_OF_TRIM_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; @@ -64,7 +69,7 @@ class TwitterStatusFetcher extends Daemon function name() { - return ('twitterstatusfetcher.generic'); + return ('twitterstatusfetcher.'.$this->_id); } /** @@ -625,6 +630,16 @@ class TwitterStatusFetcher extends Daemon declare(ticks = 1); -$fetcher = new TwitterStatusFetcher(); +if (have_option('i')) { + $id = get_option_value('i'); +} else if (have_option('--id')) { + $id = get_option_value('--id'); +} else if (count($args) > 0) { + $id = $args[0]; +} else { + $id = null; +} + +$fetcher = new TwitterStatusFetcher($id); $fetcher->runOnce(); |