Socket
Socket
Sign inDemoInstall

instagram-realtime

Package Overview
Dependencies
59
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    instagram-realtime

Event-driven, Object-oriented Instagram API Wrapper


Version published
Weekly downloads
5
Maintainers
1
Install size
3.94 MB
Created
Weekly downloads
 

Readme

Source

instagram-realtime

Event-based, object-oriented Instagram API wrapper for NodeJS

That is, program instagram-related things, using an event-driven framework. Note that this adds middleware, which handles the Instagram API's subscription verification.

Minimal Example

var app     = require('express')();
var colors  = require('colors');
var server  = require('http').createServer(app).listen(process.env.PORT || 5000);

var InstagramStream = require('instagram-realtime');
var secrets = require('./secrets.json');

var stream = InstagramStream(
  server,
  {
    client_id     : secrets.client_id,
    client_secret : secrets.client_secret,
    url           : secrets.url,
    callback_path : 'callback'
  }
);

stream.on('unsubscribe', function (req, resp) {
  console.log('unsubscribe'.green);
  stream.subscribe({ tag : 'yolo' });
});

stream.on('new', function (req, body) {
  console.log(body);
});

app.get('/', function (req, resp) {
  resp.set('Content-Type', 'text/plain; charset=utf-8');
  resp.end('🍕🏊');
});

stream.unsubscribe('all');

Methods

Brief description of functions

subscribe

Subscribe to a hashtag:

stream.subscribe({ tag : 'yolo' });

Subscribe to a geographic location:

stream.subscribe({ lat:35.657872, lng:139.70232', radius:1000 });

Subscribe to a location by ID:

stream.subscribe({ location : 2345 });

Subscribe to all users registered with the app:

stream.subscribe({ user : true });

unsubscribe

Unsubscribe from a stream:

stream.unsubscribe();

on

Register a trigger for unsubscription:

stream.on('unsubscribe', function (response, body) {
}
stream.on('unsubscribe/error', function (error, response, body) {
}

Register a trigger for subscription:

stream.on('subscribe', function (response, body) {
}
stream.on('subscribe/error', function (error, response, body) {
}

Register a trigger for new media:

stream.on('new', function (response, body) {
}
stream.on('new/error', function (error, response, body) {
}

TODO

  1. Adjust function callbacks
  2. Update docs

License

MIT

Author

Matt Razorblade Hammerstadt @mattvvhat

Keywords

FAQs

Last updated on 26 Mar 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc