macuenca / instagram-php-api Goto Github PK
View Code? Open in Web Editor NEWA PHP implementation of the official Instagram API
A PHP implementation of the official Instagram API
Been using this code for months and it just stopped working on Apr 20 I'm not getting another response (empty) for about 25 different tags I'm looking for. Anyone know of known issues or changes in the API? Thanks in Advance
I guess it's not happened to everyone if i don't see this comment till now
I work on my local windows 7 machine with apache.
since every call to instagram API is in https protocol u have to put the curl flag CURLOPT_SSL_VERIFYPEER set to false:
in "_setOptions" function:
curl_setopt($this->handler, CURLOPT_SSL_VERIFYPEER, false);
This solves the problem for local testing use.
I was looking for a simple way to exercise pagination parameters easily.
I can see how endpoints could or "would" be used but I am also unsure of how to implement on the frontend to allow a user to easily page through their entire UserFeed after login.
I don't know actully what's the problem but deleteComment doesn't do anything for me.
I tried to do something like this:
$userinfo = $instagram->getUser($_SESSION['InstagramAccessToken']);
// After getting the response, let's iterate the payload
$ures = json_decode($userinfo, true);
$recent = json_decode($instagram->getUserRecent($ures['data']['id']),true);
foreach($recent['data'] as $media) {
foreach($media['comments']['data'] as $comment) {
if(strpos($comment['text'], 'Lorem ipsum') !== false) {
$instagram->deleteComment($media['id'], $comment['id']);
}
}
}
The data i pulled out correctly but that line of code meant to delete the comment is just doing nothing.
Similar to what was happening in #2, given this sample code:
$recent = $instagram->getLocationRecentMedia($location_id);
generates a URL that looks like:
https://api.instagram.com/v1/locations/82127/media/recent/?max_id=0&min_id=0&max_timestamp=0&min_timestamp=0&access_token={access_token}
and a response that looks like:
`{
"pagination": { },
"meta": {
"code": 200
},
"data": [ ]
}`
rather than the expected list of photos. The trouble, again like #2, is that the request is essentially asking the API "Give me everything that happened between timestamp/ID zero and timestamp/ID zero"
getUserRecent(USER_ID) returns the following (local testing) :
array(
'pagination' => array(),
'meta' => array(
'code' => (int) 200
),
'data' => array()
)
Any idea why ? Getting user data or follower list works ok...
Not an issue, but I couldn't find anywhere to get help with the code. I have the example up and running,
I have a html doc that loads my last 50 followings and a button next to each one. I would just like to know how to unfollow a user by pressing on the button next to their name.
Thanks,
Chase
For some reason whenever I post a comment, if there is an @ sign in there, nothing happens. Any help is appreciated.
Hello,
Sorry for disturbing you really.
But here's what I've done and it still doesn't work:
I tried with XAMPP, WAMP, UniServer and Apache Server with PHP
I got the same errors, I just can't get or doesn't get data from Instagram about the access token,
Could it be that it's my computer that doesn't reach or can't send the request?
If so please could you just tell me some solutions to this, it has gone many days and I'm on the same problem, I'd really appreciate it.
PS. I formatted my computer, and still got the same error, my ports are opened, and yesterday I tried your script on a webhosting, it works perfectly.
What is my problem, could you just give me some tips?
This error is from error.log
[Sun Nov 18 14:49:55.678713 2012] [:error] [pid 4256:tid 1140] [client 80.217.67.83:53654] PHP Notice: Trying to get property of non-object in C:\webserver\www\callback.php on line 33
This error is from access.log
80.217.67.83 - - [18/Nov/2012:18:48:14 +0100] "GET /callback.php?code=c66f485eeca4405392fd17392e953c77 HTTP/1.1" 200 124
80.217.67.83 - - [18/Nov/2012:18:48:15 +0100] "GET /favicon.ico HTTP/1.1" 404 209
Thank you for your time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.