diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-06-29 13:23:45 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-06-29 13:23:45 -0700 |
commit | dd1fc46f0986e5675d24208199b88150f643925d (patch) | |
tree | b19ecc1c4f60882f5cc231214398e57190d6ce14 /scripts/twitterstatusfetcher.php | |
parent | f65015b24a8448ecbb12b3897992cdaf6b563212 (diff) | |
parent | 5b8e40aaa9bdb0c07cce0cf53cd913b0c397fdc4 (diff) |
Merge branch '0.8.x' into design_reset
* 0.8.x: (32 commits)
admin indicators in groups
show section with admins in sidebar of group
update to latest (r76) version of XMPPHP
better output for common error handler
fix logging error
note when going background
change name of constructor for xmppdaemon
add a lot more logging to xmppdaemon
error in get_option_value wasn't returning a value
reformat commandline.inc
if not in daemon mode, xmppdaemon sends log to stdout
extract log-line formatting to its own function
got my background/foreground logic backwards
twitter status fetcher takes an id argument
more efficient fixup of conversations
commandline processing handles errors better
xmppdaemon.php can stay in foreground
command line arg handling a little more flexible
Daemon can optionally not go into the background
don't canonicalize people's text into URLs
...
Conflicts:
theme/base/css/display.css
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(); |