如果您只需要在标记上显示图像,则不包含包装类“instagram.class.PHP”.作为媒体& Instagram API中的标记端点不需要身份验证.您可以使用以下基于卷曲的功能来根据您的标签检索结果.
function callInstagram($url) { $ch = curl_init(); curl_setopt_array($ch,array( CURLOPT_URL => $url,CURLOPT_RETURNTRANSFER => true,CURLOPT_SSL_VERIFYPEER => false,CURLOPT_SSL_VERIFYHOST => 2 )); $result = curl_exec($ch); curl_close($ch); return $result; } $tag = 'YOUR_TAG_HERE'; $client_id = "YOUR_CLIENT_ID"; $url = 'https://api.instagram.com/v1/tags/'.$tag.'/media/recent?client_id='.$client_id; $inst_stream = callInstagram($url); $results = json_decode($inst_stream,true); //Now parse through the $results array to display your results... foreach($results['data'] as $item){ $image_link = $item['images']['low_resolution']['url']; echo '<img src="'.$image_link.'" />'; }