Git Product home page Git Product logo

nodestagram's Introduction

Nodestagram

This project started because I wanted to use instagram's API in node.js and there were no libraries yet.

Since everything is so fresh spanking new, forks/pull-requests much appreciated.

Usage

The library is intended to be used as a thin wrapper over the basic Instagram API, so the idea is to keep everything as similar to the original as possible.

Every method should be passed some parameters if needed and a callback function. The callback should accept a result and an error argument.

The convention being that when the error is null, the result contains media as returnd from the API, and when something goes wrong error is the status code as returned by the API and the result is the meta info the API returned.

For example:

var instagram = require('instagram').createClient('<client_id>', '<client_secret>');

// fetch media by id
instagram.media.id('<id>', function (images, error) { ... });

// fetch popular media
instagram.media.popular(function (images, error) { ... });

// search media
instagram.media.popular({lat: <some latitude>,
		             lng: <some longitude>},
		    function (images, error) { ... });


// get info about a tag
instagram.tags.tag('snow', function (tag, error) { ... });

// get recent media for a tag
instagram.tags.media('snow', function (tag, error) { ... });
instagram.tags.media('snow', {max_id: 5}, function (tag, error) { ... });
instagram.tags.media('snow', {min_id: 5}, function (tag, error) { ... });
instagram.tags.media('snow', {max_id: 5, min_id: 0}, function (tag, error) { ... });

// search for a tag
instagram.tags.search('snow', function (tags, error) { ... });


// get info about a location
instagram.tags.tag(1, function (tag, error) { ... });

// get recent media for a location
instagram.tags.media(1, function (tag, error) { ... });
instagram.tags.media(1, {max_id: 5}, function (tag, error) { ... });
instagram.tags.media(1, {min_id: 5}, function (tag, error) { ... });
instagram.tags.media(1, {max_id: 5, min_id: 0}, function (tag, error) { ... });

// search for a location
instagram.tags.search({lat: ..., lng: ..., distance: ...}, function (tags, error) { ... });


// get info about a specific user
instagram.users.id(1234, function (user, error) { ... });

// get recent media for a user
instagram.users.media(1234, {count: 12}, function (images, error, pagination) { ... });

// getting own media, according to given *access_token* which is a required parameter
instagram.users.self({access_token: "1337", count: 12}, function (images, error, pagination) { ... });

// search for usernames
instagram.users.search("Jack", function (users, error) { ... });
instagram.users.search({q: "John", count: 1}, function (users, error) { ... });

License

Some sort of BSD or MIT license, the general idea being:

  • this is open source
  • you must give credit where credit is due
  • not viral such as GPL
  • you still can't change the license though

nodestagram's People

Contributors

fbrandel avatar swizec 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.