mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-15 04:46:29 +00:00
Add Instagram search photos example
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require '../src/Curl.class.php';
|
||||
|
||||
|
||||
define('INSTAGRAM_CLIENT_ID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
|
||||
|
||||
$curl = new Curl();
|
||||
$curl->get('https://api.instagram.com/v1/media/search', array(
|
||||
'client_id' => INSTAGRAM_CLIENT_ID,
|
||||
'lat' => '37.8296',
|
||||
'lng' => '-122.4832',
|
||||
));
|
||||
|
||||
foreach ($curl->response->data as $media) {
|
||||
$image = $media->images->low_resolution;
|
||||
echo '<img alt="" src="' . $image->url . '" width="' . $image->width . '" height="' . $image->height . '" />';
|
||||
}
|
||||
Reference in New Issue
Block a user