implementing @gruzilla’s instagram api

On the landing page of morgenstile.at there is a collection of my latest instagram pictures. Up to now i was using the feed of a tumblr blog i was posting the pictures on. A few days ago @gruzilla released a php implementation of the instagram API. Today I implemented it into my landing page.

Though I am only using the most basic features reading my own feed not posting anything, it seems quite promising. It is well coded, but as it is quite fresh there is no real documentation. It also depends on ZendFramework. It only uses some basic parts of the framework, but you have to set up your project according to the ZendFramework concepts and provide the ZendFramework source (2500+ files). I think this is a big condition for a not to complicated API as it affects the structure of your project heavily. A quick implementation into an existing non-zf project may be tricky.

As said, once everything is set up the implementation is easy.

$inst = new Instagram();

 $inst->auth->login($username, $password, $deviceId);
 $feed = $inst->feed->user($yourId);
 $inst->run();
 $response = $feed->getResponse()->getData();

 foreach ($response as $entry) {
 $imgs[] = $entry->image_versions[1]->url;
 }

Further Informations

One thought on “implementing @gruzilla’s instagram api

  1. yee a use case! :D

    i understand that zf is a heavy dependency. in fact i only use the Zend_HTTP_Client as it is by far more convenient than using curl directly.

    my plan is to finish the implementation of the api before resolving this dependency.

    to handle this problem i will try to integrate the zend-http-client directly into the project.

Leave a Reply