Open ivanckt opened 7 years ago
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
Check php5-curl was installed. I also had same problem, but after install php5-curl package, it work.
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
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