Socket
Socket
Sign inDemoInstall

oauth-revenge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth-revenge

Sexy OAuth 1.0 Client Module


Version published
Maintainers
1
Created
Source

OAuth-Revenge

An OAuth 1.0 Client Module for Node.js

Specs

  • HTTPS Support
  • Twitter Streaming API Support
  • Following Node.js idioms

How to Use

var oauth = require('oauth-revenge');

var consumer = {
  key: 'YOUR CONSUMER KEY'
, secret: 'YOUR CONSUMER SECRET'
};

var token = {
  token: 'YOUR ACCESS/REQUEST TOKEN'
, tokenSecret: 'YOUR ACCESS/REQUEST TOKEN'
};

var signer = oauth.createHmac(consumer, token);
var client = oauth.createClient(signer);

var url = 'https://api.twitter.com/1/statuses/update.json';
var query = {
  status: 'posting my status from oauth-revenge!'
};

client.POST(url, query, function (res) {
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    console.log(chunk);
  });
  res.on('end', function () {
    console.log('<<END>>');
  });
});

var filterUrl = 'https://stream.twitter.com/1/statuses/filter.json';

var trackQuery = {
  track: '#nodejs'    
};

client.POST(filterUrl, trackQuery, function (res) {
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    var data = JSON.parse(chunk);
    console.log(data.text);
  });
});

FAQs

Package last updated on 15 Oct 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc