summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/daemons/synctwitterfriends.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TwitterBridge/daemons/synctwitterfriends.php')
-rwxr-xr-xplugins/TwitterBridge/daemons/synctwitterfriends.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/TwitterBridge/daemons/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php
index df7da0943..38a8b89eb 100755
--- a/plugins/TwitterBridge/daemons/synctwitterfriends.php
+++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php
@@ -33,7 +33,6 @@ END_OF_TRIM_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/lib/parallelizingdaemon.php';
require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitterbasicauthclient.php';
require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
/**
@@ -46,7 +45,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class SyncTwitterFriendsDaemon extends ParallelizingDaemon
{
/**
@@ -60,7 +58,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
* @return void
*
**/
-
function __construct($id = null, $interval = 60,
$max_children = 2, $debug = null)
{
@@ -72,7 +69,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
*
* @return string Name of the daemon.
*/
-
function name()
{
return ('synctwitterfriends.' . $this->_id);
@@ -111,12 +107,10 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
}
function childTask($flink) {
-
// Each child ps needs its own DB connection
// Note: DataObject::getDatabaseConnection() creates
// a new connection if there isn't one already
-
$conn = &$flink->getDatabaseConnection();
$this->subscribeTwitterFriends($flink);
@@ -128,7 +122,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
// XXX: Couldn't find a less brutal way to blow
// away a cached connection
-
global $_DB_DATAOBJECT;
unset($_DB_DATAOBJECT['CONNECTIONS']);
}
@@ -144,8 +137,8 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
$client = new TwitterOAuthClient($token->key, $token->secret);
common_debug($this->name() . '- Grabbing friends IDs with OAuth.');
} else {
- $client = new TwitterBasicAuthClient($flink);
- common_debug($this->name() . '- Grabbing friends IDs with basic auth.');
+ common_debug("Skipping Twitter friends for {$flink->user_id} since not OAuth.");
+ return $friends;
}
try {
@@ -278,4 +271,3 @@ if (have_option('d') || have_option('debug')) {
$syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug);
$syncer->runOnce();
-