$this->id = $this->notice->id;
$this->from_user_id = $this->profile->id;
- $user = User::staticGet('id', $this->profile->id);
-
- $this->iso_language_code = $user->language;
+ $user = $this->profile->getUser();
+ if (empty($user)) {
+ // Gonna have to do till we can detect it
+ $this->iso_language_code = common_config('site', 'language');
+ } else {
+ $this->iso_language_code = $user->language;
+ }
+
$this->source = $this->getSourceLink($this->notice->source);
$avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
list($action, $arg1, $arg2) = $path;
$channels = Realtime_channel::getAllChannels($action, $arg1, $arg2);
- $this->log(LOG_INFO, sprintf(_("%d candidate channels for notice %d"), $notice->id));
+ $this->log(LOG_INFO, sprintf(_("%d candidate channels for notice %d"),
+ count($channels),
+ $notice->id));
foreach ($channels as $channel) {
$shortoptions = 'fi::a';
$longoptions = array('id::', 'foreground', 'all');
-$helptext = <<<END_OF_XMPP_HELP
+$helptext = <<<END_OF_TWITTERDAEMON_HELP
Daemon script for receiving new notices from Twitter users.
-i --id Identity (default none)
(requires Stomp queue handler, status_network setup)
-f --foreground Stay in the foreground (default background)
-END_OF_XMPP_HELP;
+END_OF_TWITTERDAEMON_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
-require_once INSTALLDIR . '/lib/jabber.php';
-
class TwitterDaemon extends SpawningDaemon
{
protected $allsites = false;
{
protected $userIds;
- public function __construct(TwitterOAuthClient $auth, $baseUrl='http://betastream.twitter.com')
+ public function __construct(TwitterOAuthClient $auth, $baseUrl='https://sitestream.twitter.com')
{
parent::__construct($auth, $baseUrl);
}