Skip to content
Browse files

Committing change submited by woodardj

  • Loading branch information...
1 parent c8e51b7 commit e49a675e165b2e2851eadab17d03dd7e4d74cf87 @macuenca committed Jan 8, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 Instagram.php
View
18 Instagram.php
@@ -2,7 +2,7 @@
/**
* Instagram PHP implementation API
* URLs: http://www.mauriciocuenca.com/
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@@ -36,7 +36,7 @@ class Instagram {
'access_token' => 'https://api.instagram.com/oauth/access_token',
'user' => 'https://api.instagram.com/v1/users/%d/?access_token=%s',
'user_feed' => 'https://api.instagram.com/v1/users/self/feed?%s',
- 'user_recent' => 'https://api.instagram.com/v1/users/%d/media/recent/?access_token=%s&max_id=%d&min_id=%d&max_timestamp=%d&min_timestamp=%d',
+ 'user_recent' => 'https://api.instagram.com/v1/users/%s/media/recent/?access_token=%s&max_id=%s&min_id=%s&max_timestamp=%s&min_timestamp=%s',
'user_search' => 'https://api.instagram.com/v1/users/search?q=%s&access_token=%s',
'user_follows' => 'https://api.instagram.com/v1/users/%d/follows?access_token=%s',
'user_followed_by' => 'https://api.instagram.com/v1/users/%d/followed-by?access_token=%s',
@@ -81,7 +81,7 @@ class Instagram {
* @var string
*/
protected $_accessToken = null;
-
+
/**
* OAuth user object
* @var object
@@ -150,29 +150,29 @@ protected function _setOauthToken() {
*/
public function getAccessToken() {
if ($this->_accessToken == null) {
-
+
if ($this->_oauthToken == null) {
$this->_setOauthToken();
}
-
+
$this->_accessToken = json_decode($this->_oauthToken)->access_token;
}
return $this->_accessToken;
}
-
+
/**
* Return the decoded user object
* from the OAuth JSON encoded token
* @return object
*/
public function getCurrentUser() {
if ($this->_currentUser == null) {
-
+
if ($this->_oauthToken == null) {
$this->_setOauthToken();
}
-
+
$this->_currentUser = json_decode($this->_oauthToken)->user;
}
@@ -204,7 +204,7 @@ public function openAuthorizationUrl() {
header('Location: ' . $this->getAuthorizationUrl());
exit(1);
}
-
+
/**
* Generate Instagram credentials verification page URL.
* Usefull for creating a link to the Instagram authentification page.

2 comments on commit e49a675

@sshilko

'authorize' endpoint does not support display=touch
''authorize'' endpoint does not support count parameter and
getUserRecent has WRONG descripton for maxId/minId params

i thought it was better build lib :| disappointed

@sshilko

curl client throws warnings for getResponse() when he tries to close non-existing handle

Please sign in to comment.
Something went wrong with that request. Please try again.