Giter Club home page Giter Club logo

node-twatch's Introduction

node-twatch

Monitor specific tweets and post to Slack.

node-twatch

Install

npm (global)

$ npm install node-twatch -g

clone

$ git clone [email protected]:kokushin/node-twatch.git
$ cd node-twatch
$ npm install

download here

$ unzip node-twatch-master.zip
$ cd node-twatch-master
$ npm install

Usage

Open config.json in a text editor and enter the Twitter API key and Slack's API key.

๐Ÿ’ก When npm install node-twatch -g is executed, config.json exists in /usr/local/lib/node_modules/node-twatch.

  • How to get Twitter API key here
  • How to get Slack API key here
{
  "twitter": {
    "consumer_key": "YOUR_CONSUMER_KEY",
    "consumer_secret": "YOUR_CONSUMER_SECRET",
    "access_token_key": "YOUR_ACCESS_TOKEN_KEY",
    "access_token_secret": "YOUR_ACCESS_TOKEN_SECRET"
  },
  "slack": {
    "token": "YOUR_ACCESS_TOKEN_KEY",
    "channel": "YOUR_CHANNEL_NAME"
  }
}

When you enter the following command, Twatch starts monitoring.

๐Ÿ’ก Twitter users to monitor must "follow".

npm (global)

$ twatch

clone & download

$ npm run twatch

Press Ctrl + C to stop monitoring.

Options

There is an option to specify the Twitter ID to be monitored and the keyword contained within tweet respectively.

-u, -user

You can specify the ID of the Twitter user to monitor. It is possible to specify more than one with ",".

npm (global)

$ twatch -u user_id1,user_id2

clone & download

$ npm run twatch -- --u user_id1,user_id2

-k, -keyword

You can specify keywords to be included in the tweets to be monitored. Uppercase and lowercase letters are not distinguished. It is possible to specify more than one with ",".

npm (global)

$ twatch -k keyword1,keyword2

clone & download

$ npm run twatch -- --k keyword1,keyword2

-l, -link

Available from v1.1.0

When this option is specified, only tweets containing links are monitored.

npm (global)

$ twatch -l

clone & download

$ npm run twatch -- --l

combine

These options can be used in combination.

npm (global)

$ twatch -u user_id1,user_id2 -k keyword1,keyword2 -l

clone & download

$ npm run twatch -- --u user_id1,user_id2 --k keyword1,keyword2 --l

๐Ÿ’ก If you do not specify an option, we will monitor all followers and tweets.

Trouble shooting

Error: Status Code: 401

The API key is not set correctly. You need to check and edit config.json.

Error: Status Code: 420

Since the requests are concentrated, please wait for a while before running.

Contributor

@kokushin

License

Code and documentation copyright 2017 by kokushin. Code released under the MIT License.

node-twatch's People

Contributors

kokushin avatar

Stargazers

Lisa avatar  avatar  avatar

Watchers

 avatar Lisa avatar  avatar

node-twatch's Issues

Error: Status Code: 404

Hello, I found the following error as required, thank you

npm run twatch -- --u realDonaldTrump

Error: Status Code: 404
at Request. (/Users/xxxxx/Desktop/WatchDog/node-twatch/node_modules/twitter/lib/twitter.js:277:28)
at Request.emit (events.js:193:13)
at Request.onRequestResponse (/Users/xxxxx/Desktop/WatchDog/node-twatch/node_modules/request/request.js:1066:10)
at ClientRequest.emit (events.js:193:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:560:23)
at HTTPParser.parserOnHeadersComplete (_http_common.js:113:17)
at TLSSocket.socketOnData (_http_client.js:447:22)
at TLSSocket.emit (events.js:193:13)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:276:11)

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.