New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

twitter-cmd

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-cmd

Execute functions in node when prompted by twitter messages

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

twitter-cmd

Execute functions in node when prompted by twitter direct messages. Uses twitter user stream.

requirements

twit (1.1.x): https://github.com/ttezel/twit

installation

npm install twit twitter-cmd

usage

Sending the twitter message 'hello' to the attached API account will log some output to console.

var T = require('twit');
var TC = require('twitter-cmd');

var twitter = new T({
  consumer_key: '...',
  consumer_secret: '...',
  access_token: '...',
  access_token_secret: '...'
});

var twitterCmd = new TC(twitter);

twitterCmd.addUser('kaftz');
twitterCmd.bind('hello', function (user) {
  console.log('hello ' + user);
});

options

You may pass an options object when initializing.

var twitterCmd = new TC(twitter, { /* options */ });
  • streamOptions an object containing twitter stream options
  • key keyword required before command, defaults to none ([keyword] [command] [args])
  • allowAll boolean allowing or disallowing any DM-capable users to access commands, defaults to false

API

addUser(user), removeUser(user)

add or remove a user from access list

getUsernames()

returns an array of usernames

getUser(name)

returns user object or false if not found

addUserCmds(name, commands), removeUserCmds(name, commands)

allow or disallow user to call commands (commands a String or Array)

addAllCmds(commands), removeAllCmds

allow or disallow all users to call commands

bind(name, fn), unbind(name)

bind or unbind command

message(target, msg, cb)

send a DM to target user, optional callback

license

MIT

Keywords

FAQs

Package last updated on 17 Jun 2014

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