Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CURL get nothing #27

Open
ivanckt opened this issue Dec 22, 2016 · 3 comments
Open

The CURL get nothing #27

ivanckt opened this issue Dec 22, 2016 · 3 comments

Comments

@ivanckt
Copy link

ivanckt commented Dec 22, 2016

I got the following errors when running the example.php

Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 68
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 88
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 88
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 110
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 110
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 125
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 125
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 139
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 139
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 68
Notice: Trying to get property of non-object in C:\xampp\htdocs\igtest\src\Instagram.php on line 68
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\igtest\test\example.php on line 21
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\igtest\test\example.php on line 27

I have checked that the curl in the function "getContentsFromUrl" return empty

@ivanckt
Copy link
Author

ivanckt commented Dec 22, 2016

BTW, i used the chrome plugin "Postman" with the following code and I can get result from the instagram.

POST /query/ HTTP/1.1
Host: www.instagram.com
X-CsrfToken: xuPHeknUZSh9aaWdzi0M3Qohisp7W2Tz
Referer: https://www.instagram.com/
Cache-Control: no-cache
Postman-Token: 18e204b6-418c-6997-8dc0-88154b52bed0
Content-Type: application/x-www-form-urlencoded

q=ig_hashtag(apple)+%7B+media.first(12)+%7B++count%2C++nodes+%7B++++caption%2C++++code%2C++++comments+%7B++++++count++++%7D%2C++++comments_disabled%2C++++date%2C++++dimensions+%7B++++++height%2C++++++width++++%7D%2C++++display_src%2C++++id%2C++++is_video%2C++++likes+%7B++++++count++++%7D%2C++++owner+%7B++++++id++++%7D%2C++++thumbnail_src%2C++++video_views++%7D%2C++page_info%7D+%7D

@ghost
Copy link

ghost commented Dec 23, 2016

Check php5-curl was installed.
I also had same problem, but after install php5-curl package, it work.

@ivanckt
Copy link
Author

ivanckt commented Dec 23, 2016

just found in the other post that we need :

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); in the instragram.php, otherwise the curl exec return nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant