cosenary / Instagram-PHP-API

An easy-to-use PHP Class for accessing Instagram's API.
http://cosenary.github.com/Instagram-PHP-API
BSD 3-Clause "New" or "Revised" License
1.46k stars 781 forks source link

getUserMedia doesn't require an access token #23

Closed RichHatch closed 10 years ago

RichHatch commented 10 years ago

This request can work simply by supplying a client_id. I've fixed this on a feature branch locally but don't have access to push the branch.

Jany-M commented 10 years ago

Yep, please update/add method? In the meantime, if anyone needs it, in instagram.class.php, replace:

 /**
   * Get user recent media
   *
   * @param integer [optional] $id        Instagram user ID
   * @param integer [optional] $limit     Limit of returned results
   * @return mixed
   */
  public function getUserMedia($id = 'self', $limit = 0) {
    return $this->_makeCall('users/' . $id . '/media/recent', true, array('count' => $limit));
  }

with

  /**
   * Get user recent media
   *
   * @param integer [optional] $id        Instagram user ID (default to self)
   * @param integer [optional] $limit     Limit of returned results
   * @param boolean [optional] $auth     Requires OAuth? (default to False - will retrieve what's publicly available)
   * @return mixed
   */
  public function getUserMedia($id = 'self', $auth = false, $limit = 0) {
    return $this->_makeCall('users/' . $id . '/media/recent', $auth, array('count' => $limit));
  }
cosenary commented 10 years ago

Thanks for your hint and the code fix. I'll update the class accordingly.

cosenary commented 10 years ago

Implemented in version 2.1 (e6e3785c2442e27b0f2ac88cbdf90037f9007fbc)