Allow custom apiroot for site streams testing on streamtest
This commit is contained in:
parent
905d621b6f
commit
28703deb8f
|
@ -28,7 +28,7 @@
|
||||||
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
|
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
|
||||||
|
|
||||||
$shortoptions = 'n:';
|
$shortoptions = 'n:';
|
||||||
$longoptions = array('nick=','import','all');
|
$longoptions = array('nick=','import','all','apiroot=');
|
||||||
|
|
||||||
$helptext = <<<ENDOFHELP
|
$helptext = <<<ENDOFHELP
|
||||||
USAGE: streamtest.php -n <username>
|
USAGE: streamtest.php -n <username>
|
||||||
|
@ -36,6 +36,7 @@ USAGE: streamtest.php -n <username>
|
||||||
-n --nick=<username> Local user whose Twitter timeline to watch
|
-n --nick=<username> Local user whose Twitter timeline to watch
|
||||||
--import Experimental: run incoming messages through import
|
--import Experimental: run incoming messages through import
|
||||||
--all Experimental: run multiuser; requires nick be the app owner
|
--all Experimental: run multiuser; requires nick be the app owner
|
||||||
|
--apiroot=<url> Provide alternate streaming API root URL
|
||||||
|
|
||||||
Attempts a User Stream connection to Twitter as the given user, dumping
|
Attempts a User Stream connection to Twitter as the given user, dumping
|
||||||
data as it comes.
|
data as it comes.
|
||||||
|
@ -86,7 +87,12 @@ function siteStreamForOwner(User $user)
|
||||||
{
|
{
|
||||||
// The user we auth as must be the owner of the application.
|
// The user we auth as must be the owner of the application.
|
||||||
$auth = twitterAuthForUser($user);
|
$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
|
// Pull Twitter user IDs for all users we want to pull data for
|
||||||
$userIds = array();
|
$userIds = array();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user