Permalink
Browse files

deprecated get_lists_id

  • Loading branch information...
1 parent 4b5b591 commit 74ee39d59e21570c3e30a2a95c920f5cc7976c24 @nojimage nojimage committed May 11, 2012
Showing with 37 additions and 1 deletion.
  1. +37 −1 models/datasources/twitter_source.php
@@ -1082,13 +1082,49 @@ public function lists($params = array()) {
*
* @return array|false
* @see http://dev.twitter.com/doc/get/:user/lists/:id
+ * @deprecated
*/
public function get_lists_id($user, $id, $params = array()) {
if (empty($user) || empty($id)) {
return false;
}
- $url = sprintf('http://api.twitter.com/1/%s/lists/%s.json', $user, $id);
+ if (!is_numeric($id)) {
+ $params['slug'] = $id;
+ if (is_numeric($user)) {
+ $params['owner_id'] = $user;
+ } else {
+ $params['owner_screen_name'] = $user;
+ }
+ } else {
+ $params['list_id'] = $list_id;
+ }
+
+ return $this->lists_show($params);
+ }
+
+/**
+ * GET lists/show
+ *
+ * @param string $user
+ * @param string $id
+ * @param array $params
+ * list_id:
+ * slug:
+ * owner_screen_name:
+ * owner_id:
+ *
+ * @return array|false
+ * @see https://dev.twitter.com/docs/api/1/get/lists/show
+ */
+ public function lists_show($params = array()) {
+ if ((empty($params['list_id']) && empty($params['slug']))
+ || (isset($params['slug']) && empty($params['owner_screen_name']) && empty($params['owner_id']))
+ ) {
+ return false;
+ }
+
+ $url = self::TWITTER_API_URL_BASE_HTTPS . '1/lists/show.json';
$method = 'GET';
// request

0 comments on commit 74ee39d

Please sign in to comment.