Code Monkey home page Code Monkey logo

gogoig's Introduction

gogoig

PHP Instagram API ver 0.1

How to use

  1. Go to http://instagram.com/developer/ to get a client id.

  2. Include gogoig.php .

  3. Code below:

     $ig = new gogoig(YOUR_CLIENT_ID);
     $result = $ig->getUserMedia(USER_NAME, 2);
    

    Result will be a array such like:

     Array
     (
         [0] => Array
             (
                 [url] => http://image_path.jpg
                 [width] => 640
                 [height] => 640
                 [created_time] => 1420972680
             )
         [1] => Array
             (
                 [url] => http://image_path.jpg.jpg
                 [width] => 640
                 [height] => 640
                 [created_time] => 1420877820
             )
     )
    

Full paragrams

$count : Count of media to return.

$max_timestamp : Return media before this UNIX timestamp.

    $ig->getUserMedia(USER_NAME, $count, $max_timestamp);

Get someone's all public images

** You should run this one time to save all received datas, not use it everytime. **

    $ig = new gogoig(YOUR_CLIENT_ID);
    $user_media = array(); // here you are
    $more_flag = true;
    $user_name = 'akiyo0414';
    $count = 30;
    $max_timestamp = '';
    
    do {
        $arr = $ig->getUserMedia($user_name,$count,$max_timestamp);
        if ( count($arr) > 0) {
            $user_media = array_merge($user_media , $arr);
            $last_one = array_pop($arr);
            $max_timestamp = $last_one['created_time'];
        } else {
            $more_flag = false;
        }
    } while($more_flag);
    
    print_r($user_media);

gogoig's People

Contributors

itisjoe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.