Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bolandish committed Jun 9, 2016
1 parent 51a7705 commit 9116e06
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Bolandish;

class Instagram {
public static function getMediaByHashtag($hashtag = null, $count = 16, $return_type = "object")
public static function getMediaByHashtag($hashtag = null, $count = 16, $assoc = false)
{
if ( empty($hashtag) || !is_string($hashtag) )
{
Expand All @@ -11,33 +11,33 @@ public static function getMediaByHashtag($hashtag = null, $count = 16, $return_t
$hashtag = strtolower($hashtag);
$parameters = urlencode("ig_hashtag($hashtag) { media.first($count) { count, nodes { caption, code, comments { count }, date, dimensions { height, width }, display_src, id, is_video, likes { count }, owner { id, username }, thumbnail_src, video_views, video_url }, page_info } }");
$url = "https://www.instagram.com/query/?q=$parameters&ref=tags%3A%3Ashow";
$media = json_decode(file_get_contents($url), ($return_type == "array"));
$media = json_decode(file_get_contents($url), ($assoc || $assoc == "array"));
$media = $media->media->nodes;
return $media;
}

public static function getMediaByUserID($user = null, $count = 16, $return_type = "object")
public static function getMediaByUserID($user = null, $count = 16, $assoc = false)
{
if ( empty($user) || !(is_string($user) || is_int($user)) )
{
return false;
}
$parameters = urlencode("ig_user($user) { media.first($count) { count, nodes { caption, code, comments { count }, date, dimensions { height, width }, display_src, id, is_video, likes { count }, owner { id, username }, thumbnail_src, video_views, video_url }, page_info } }");
$url = "https://www.instagram.com/query/?q=$parameters&ref=tags%3A%3Ashow";
$media = json_decode(file_get_contents($url),($return_type == "array"));
$media = json_decode(file_get_contents($url),($assoc || $assoc == "array"));
$media = $media->media->nodes;
return $media;
}

public static function getMediaAfterByUserID($user = null,$min_id, $count = 16, $return_type = "object")
public static function getMediaAfterByUserID($user = null, $min_id, $count = 16, $assoc = false)
{
if ( empty($user) || !(is_string($user) || is_int($user)) )
{
return false;
}
$parameters = urlencode("ig_user($user) { media.after($min_id,$count) { count, nodes { caption, code, comments { count }, date, dimensions { height, width }, display_src, id, is_video, likes { count }, owner { id, username }, thumbnail_src, video_views, video_url }, page_info } }");
$url = "https://www.instagram.com/query/?q=$parameters&ref=tags%3A%3Ashow";
$media = json_decode(file_get_contents($url),($return_type == "array"));
$media = json_decode(file_get_contents($url),($assoc || $assoc == "array"));
$media = $media->media->nodes;
return $media;
}
Expand Down

0 comments on commit 9116e06

Please sign in to comment.