diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-10 10:06:20 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-10 10:06:20 -0700 |
commit | 6a0f0e32d5e837c3f0f2041bc206fc35d69f497c (patch) | |
tree | e9ce262b15006927ffc46c71a89ecb1a3ebfadbd /lib/twitterapi.php | |
parent | 03ccb74052ccec209adedfcd9daf4648905b322b (diff) | |
parent | bafa1ab1c532118e2230df50ed18a1b4573692b7 (diff) |
Merge branch '0.8.x' into 0.9.x
Diffstat (limited to 'lib/twitterapi.php')
-rw-r--r-- | lib/twitterapi.php | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 8f902cbca..f48513e67 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -89,7 +89,7 @@ class TwitterapiAction extends Action $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; $twitter_user['protected'] = false; # not supported by Laconica yet - $twitter_user['followers_count'] = $this->count_subscriptions($profile); + $twitter_user['followers_count'] = $profile->subscriberCount(); // To be supported soon... $twitter_user['profile_background_color'] = ''; @@ -98,17 +98,11 @@ class TwitterapiAction extends Action $twitter_user['profile_sidebar_fill_color'] = ''; $twitter_user['profile_sidebar_border_color'] = ''; - $subbed = DB_DataObject::factory('subscription'); - $subbed->subscriber = $profile->id; - $subbed_count = (int) $subbed->count() - 1; - $twitter_user['friends_count'] = (is_int($subbed_count)) ? $subbed_count : 0; + $twitter_user['friends_count'] = $profile->subscriptionCount(); $twitter_user['created_at'] = $this->date_twitter($profile->created); - $faves = DB_DataObject::factory('fave'); - $faves->user_id = $user->id; - $faves_count = (int) $faves->count(); - $twitter_user['favourites_count'] = $faves_count; // British spelling! + $twitter_user['favourites_count'] = $profile->faveCount(); // British spelling! // Need to pull up the user for some of this $user = User::staticGet($profile->id); @@ -129,11 +123,7 @@ class TwitterapiAction extends Action $twitter_user['profile_background_image_url'] = ''; $twitter_user['profile_background_tile'] = false; - $notices = DB_DataObject::factory('notice'); - $notices->profile_id = $profile->id; - $notice_count = (int) $notices->count(); - - $twitter_user['statuses_count'] = (is_int($notice_count)) ? $notice_count : 0; + $twitter_user['statuses_count'] = $profile->noticeCount(); // Is the requesting user following this user? $twitter_user['following'] = false; @@ -396,7 +386,7 @@ class TwitterapiAction extends Action $enclosure = $entry['enclosures'][0]; $this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null); } - + $this->elementEnd('item'); } |