Created
April 3, 2012 17:42
-
-
Save maxparm/2294032 to your computer and use it in GitHub Desktop.
Revisions
-
maxparm revised this gist
Apr 12, 2012 . No changes.There are no files selected for viewing
-
maxparm created this gist
Apr 3, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?php //Get data from instagram api $hashtag = 'max'; //Query need client_id or access_token $query = array( 'client_id' => '', 'count' => 3 ); $url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?'.http_build_query($query); try { $curl_connection = curl_init($url); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); //Data are stored in $data $data = json_decode(curl_exec($curl_connection), true); curl_close($curl_connection); } catch(Exception $e) { return $e->getMessage(); } ?>