X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Ftwitterstatusfetcher.php;h=e1745cfc089614f41aa8a5766f179e72a924f836;hb=749d9bfbbf65d962804bea1fa510039da185179f;hp=8b10bfbadda5c5396f82c38c923da5a0526288ec;hpb=a4d0f22b4b2907134779d7710f967c4841f6f938;p=quix0rs-gnu-social.git diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 8b10bfbadd..e1745cfc08 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -25,19 +25,18 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('MAXCHILDREN', 2); define('POLL_INTERVAL', 60); // in seconds -$shortoptions = 'i::'; -$longoptions = array('id::'); +$shortoptions = 'di::'; +$longoptions = array('id::', 'debug'); $helptext = <<set_id($id); + } + } + /** * Name of this daemon * @@ -80,6 +88,11 @@ class TwitterStatusFetcher extends Daemon function run() { + if (defined('SCRIPT_DEBUG')) { + common_debug($this->name() . + ': debugging log output enabled.'); + } + do { $flinks = $this->refreshFlinks(); @@ -317,7 +330,7 @@ class TwitterStatusFetcher extends Daemon $notice->rendered = common_render_content($notice->content, $notice); $notice->source = 'twitter'; $notice->reply_to = null; // XXX lookup reply - $notice->is_local = NOTICE_GATEWAY; + $notice->is_local = Notice::GATEWAY; if (Event::handle('StartNoticeSave', array(&$notice))) { $id = $notice->insert(); @@ -640,6 +653,10 @@ if (have_option('i')) { $id = null; } +if (have_option('d') || have_option('debug')) { + define('SCRIPT_DEBUG', true); +} + $fetcher = new TwitterStatusFetcher($id); $fetcher->runOnce();