]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
twitterstatusfetcher.php uses commandline.inc
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 22 Jun 2009 23:39:21 +0000 (16:39 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 22 Jun 2009 23:39:21 +0000 (16:39 -0700)
scripts/twitterstatusfetcher.php

index c18261b5b9d28a6e878dfd63d35ee370f9739ee5..5ffdda58fafb8fdcd2ad643bfa1ca4bd918d1a3c 100755 (executable)
  * along with this program.     If not, see <http://www.gnu.org/licenses/>.
  */
 
-// Abort if called from a web server
-if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
-    print "This script must be run from the command line\n";
-    exit();
-}
-
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-define('LACONICA', true);
 
 // Tune number of processes and how often to poll Twitter
 // XXX: Should these things be in config.php?
 define('MAXCHILDREN', 2);
 define('POLL_INTERVAL', 60); // in seconds
 
-// Uncomment this to get useful logging
-// define('SCRIPT_DEBUG', true);
+$helptext = <<<END_OF_TRIM_HELP
+Batch script for retrieving Twitter messages from foreign service.
 
-// Preset the server at the command line
+END_OF_TRIM_HELP;
 
-$server = ($argc > 2) ? $argv[2] : null;
-$path   = ($argc > 3) ? $argv[3] : null;
+require_once INSTALLDIR.'/scripts/commandline.inc';
 
 require_once INSTALLDIR . '/lib/common.php';
 require_once INSTALLDIR . '/lib/daemon.php';
@@ -631,10 +623,6 @@ class TwitterStatusFetcher extends Daemon
     }
 }
 
-ini_set("max_execution_time", "0");
-ini_set("max_input_time", "0");
-set_time_limit(0);
-mb_internal_encoding('UTF-8');
 declare(ticks = 1);
 
 $fetcher = new TwitterStatusFetcher();