. * * @category Plugin * @package StatusNet * @author Brion Vibber * @copyright 2010 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ /** * Stream listener for Twitter User Streams API * http://dev.twitter.com/pages/user_streams * * This will pull the home stream and additional events just for the user * we've authenticated as. */ class TwitterUserStream extends TwitterStreamReader { public function __construct(TwitterOAuthClient $auth, $baseUrl='https://userstream.twitter.com') { parent::__construct($auth, $baseUrl); } public function connect($method='2/user.json') { return parent::connect($method); } /** * Each message in the user stream is just ready to go. * * @param array $data */ function routeMessage(stdClass $data) { $context = array( 'source' => 'userstream' ); parent::handleMessage($data, $context); } }