Skip to content

Commit 5e7b16b

Browse files
committed
Add Instagram search photos example
1 parent 2f18692 commit 5e7b16b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/instagram_search_photos.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
require '../src/Curl.class.php';
3+
4+
5+
define('INSTAGRAM_CLIENT_ID', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
6+
7+
$curl = new Curl();
8+
$curl->get('https://api.instagram.com/v1/media/search', array(
9+
'client_id' => INSTAGRAM_CLIENT_ID,
10+
'lat' => '37.8296',
11+
'lng' => '-122.4832',
12+
));
13+
14+
foreach ($curl->response->data as $media) {
15+
$image = $media->images->low_resolution;
16+
echo '<img alt="" src="' . $image->url . '" width="' . $image->width . '" height="' . $image->height . '" />';
17+
}

0 commit comments

Comments
 (0)