From 28703deb8f864575135c2ea94facc60c6ca9945b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 2 Nov 2010 16:26:51 -0700 Subject: [PATCH] Allow custom apiroot for site streams testing on streamtest --- plugins/TwitterBridge/scripts/streamtest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/TwitterBridge/scripts/streamtest.php b/plugins/TwitterBridge/scripts/streamtest.php index a175c1efa5..aad15fdeab 100644 --- a/plugins/TwitterBridge/scripts/streamtest.php +++ b/plugins/TwitterBridge/scripts/streamtest.php @@ -28,7 +28,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); $shortoptions = 'n:'; -$longoptions = array('nick=','import','all'); +$longoptions = array('nick=','import','all','apiroot='); $helptext = << @@ -36,6 +36,7 @@ USAGE: streamtest.php -n -n --nick= Local user whose Twitter timeline to watch --import Experimental: run incoming messages through import --all Experimental: run multiuser; requires nick be the app owner + --apiroot= Provide alternate streaming API root URL Attempts a User Stream connection to Twitter as the given user, dumping data as it comes. @@ -86,7 +87,12 @@ function siteStreamForOwner(User $user) { // The user we auth as must be the owner of the application. $auth = twitterAuthForUser($user); - $stream = new TwitterSiteStream($auth); + + if (have_option('apiroot')) { + $stream = new TwitterSiteStream($auth, get_option_value('apiroot')); + } else { + $stream = new TwitterSiteStream($auth); + } // Pull Twitter user IDs for all users we want to pull data for $userIds = array(); -- 2.39.5