SET YOUR VEHICLE
Order Now, Pay Later
FREE SHIPPING
On orders over $70
TALK TO A PARTS EXPERT
LOWEST PRICE
Guaranteed
function scrape_insta_hash($tag) { $insta_source = file_get_contents('https://www.instagram.com/explore/tags/'.$tag.'/'); // instagrame tag url $shards = explode('window._sharedData = ', $insta_source); $insta_json = explode(';', $shards[1]); $insta_array = json_decode($insta_json[0], TRUE); return $insta_array; // this return a lot things print it and see what else you need } $tag = "#northridgenation"; $results_array = scrape_insta_hash($tag); $limit = 18; // provide the limit thats important because one page only give some images then load more have to be clicked for ($i=$limit; $i >= 0; $i--) { if(array_key_exists($i,$results_array['entry_data']['TagPage'][0]["graphql"]["hashtag"]["edge_hashtag_to_media"]["edges"])){ $latest_array = $results_array['entry_data']['TagPage'][0]["graphql"]["hashtag"]["edge_hashtag_to_media"]["edges"][$i]["node"]; $newPosting = [ "image"=>$latest_array['display_url'], "thumbnail"=>$latest_array['thumbnail_src'], "instagram_id"=>$latest_array['id'], "caption"=>$latest_array['caption']['edge_media_to_caption']['edges'][0]["node"]["text"], "link"=>"https://www.instagram.com/p/".$latest_array['shortcode'], "date"=>$latest_array['taken_at_timestamp'] ]; echo "
"; 
      print_r($newPosting); 
      echo "/
"; 

  }
}