-
Notifications
You must be signed in to change notification settings - Fork 0
/
Instagram.php
50 lines (41 loc) · 1.08 KB
/
Instagram.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
// Remove this from SKYFIRE
define('INSTAGRAM_ACCESS_TOKEM', 123456789);
// http://instagram.com/developer/authentication/
class Instagram
{
const HASHTAG = 0;
const USER = 1;
private $url;
public function __construct($needle, $type = 0)
{
switch ($type)
{
case 0:
$this->url = 'https://'.
'api.instagram.com'.
'/v1'.
'/tags'.
'/'.$needle.
'/media'.
'/recent'.
'?access_token='. INSTAGRAM_ACCESS_TOKEM;
break;
}
}
public function get($limit = 10)
{
$edit = json_decode(file_get_contents($this->url), TRUE);
$output = $edit['data'];
if ($output)
{
return json_encode($output);
}
else
{
return FALSE;
}
}
}
// $data = new Instagram('luxembourg', Instagram::HASHTAG);
// echo $data->get();