Spectragram is a Gateway to Instagram API

Curtis Chen
Nov. 22 2012, 09:00AM EST

"A picture is worth a thousand words," the old saying goes, and Instagram's 7.3 million daily active users would seem to agree. But how does anybody find anything in that sea of over 5 million new photos every day? A new JavaScript library named Spectragram provides an easy way for developers to add Instagram photos to a web site or app, without needing to learn all the ins and outs of the sprawling Instagram API.

right: images tagged 'converse'

Created by Adrian Quevedo, "a Multimedia Engineer living in Bogotá, Colombia," Spectragram is a plugin for jQuery (according to some analysts, the most popular JavaScript framework on the Internet) which offers simple methods to return one of three different lists:

  • The most recent photos published by a specified Instagram user;
  • The most popular Instagram photos at the moment; or
  • A list of Instagram photos tagged with a specific keyword.

Results are returned to the jQuery container element which issued the query, and can be "wrapped" in a particular HTML tag for convenience; the provided code examples illustrate how to call Spectragram from a 'ul' (unordered list) element and get the list of results inside 'li' (list item) tags. Other options include the maximum number of results to return (default: ten) and the size of the photo images (default: medium).

Though Spectragram's first and third methods are straightforward, developers should note that "popular" photos are determined by Instagram using an undisclosed, internal algorithm. Earlier this year, third-party developer SnapWidget attempted to reverse-engineer how Instagram chooses "popular" photos, with limited success; they concluded that several factors were used, including total number of likes, how many followers the posting user has, and how quickly a photo accumulated likes and comments after it was first posted. This corroborates other analyses, so developers who want more control will have to access the Instagram API directly and use additional meta-data to filter their results.

For detailed documentation on the Spectragram library, visit its GitHub repository.

Curtis Chen Once a software engineer in Silicon Valley; now a science fiction writer and puzzle hunt maker near Portland, Oregon. You may have seen his "Cat Feeding Robot" Ignite presentation. Curtis is not an aardvark.

Comments

Comments(1)