php - Don't get any response by Instagram API -
php - Don't get any response by Instagram API -
here code :
<?php function fetchdata($url){ $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_timeout, 20); $result = curl_exec($ch); curl_close($ch); homecoming $result; } $result = fetchdata("https://api.instagram.com/v1/users/search?q=majoe_47&access_token=[hidden]"); var_dump($result); $result = json_decode($result); foreach ($result->data $post) { // data. } ?>
output: bool(false)
output on direct url :
{"meta":{"code":200},"data":[{"username":"majoe_47","bio":"breiter als der t\u00fcrsteher","website":"http:\/\/www.facebook.com\/majoeduisburg","profile_picture":"http:\/\/photos-a.ak.instagram.com\/hphotos-ak-xfa1\/10584773_1460870534165160_603268483_a.jpg","full_name":"majoe","id":"256143447"} [..more code ..]}]}
why don't reponse ? :/
function fetchdata($url) { $channel = curl_init(); curl_setopt($channel, curlopt_url, $url); curl_setopt($channel, curlopt_returntransfer, true); curl_setopt($channel, curlopt_connecttimeout, 10); curl_setopt($channel, curlopt_timeout, 10); curl_setopt($channel, curlopt_encoding , "gzip"); curl_setopt($channel, curlopt_verbose, true); curl_setopt($channel, curlopt_followlocation, true); curl_setopt($channel, curlopt_ipresolve, curl_ipresolve_v4); curl_setopt($channel, curlopt_ssl_verifypeer, false); //add curl_setopt($channel, curlopt_ssl_verifyhost, false); // , line back upwards https $output = curl_exec($channel); curl_close($channel); homecoming $output; }
php api instagram
Comments
Post a Comment