Example #1
0
 public function getFriendsList($limit, &$next)
 {
     global $USER;
     $tw = new CTwitterInterface();
     $userId = self::TwitterUserId($USER->GetID());
     if ($userId > 0) {
         $res = $tw->getUserFriends($userId, $limit, $next);
         if (is_array($res) && is_array($res['users'])) {
             foreach ($res['users'] as $key => $contact) {
                 $res['users'][$key]['uid'] = $contact['id_str'];
                 $res['users'][$key]['url'] = "https://twitter.com/" . $contact["screen_name"];
                 $res['users'][$key]['first_name'] = $contact['name'];
                 if ($contact['profile_image_url']) {
                     $res['users'][$key]['picture'] = CMain::IsHTTPS() ? $contact['profile_image_url_https'] : $contact['profile_image_url'];
                     $res['users'][$key]['picture'] = preg_replace("/_normal\\./i", ".", $res['users'][$key]['picture']);
                 }
             }
             return $res['users'];
         }
     }
     return false;
 }