GithubHelp home page GithubHelp logo

node-twitter-bot's Introduction

Node Twitter Bot

Join the chat at https://gitter.im/nikolenkoanton92/node-twitter-bot

This version is Unstable, You can use for fun.

Installation

The easiest way to install node-twitter-bot is with npm

npm install node-twitter-bot

Alternately, download the source.

git clone https://github.com/nikolenkoanton92/node-twitter-bot.git

Features

  • follow users by tweet
  • follow user by specified user
  • unfollow users

Usage

You will also need to create an app account on https://dev.twitter.com/apps

  • Sign in with your Twitter account
  • Create a new app account
  • Modify the settings for that app account to allow read & write
  • Generate a new OAuth token with those permissions

Following these steps will create 4 tokens that you will need to place in the configuration file discussed below.

consumerKey , consumerSecret , accessToken , accessTokenSecret are your API keys that you received from creating your app account.

var  NodeTwitterBot = require('node-twitter-bot');

var nodeTwitterBot = new NodeTwitterBot({
  consumerKey : 'Your Consumer Key',
  consumerSecret : 'Your consumer Secret',
  accessToken : 'Your access Token',
  accessTokenSecret : 'Your access Token Secret'
});

API

This API should work exactly the same in node. Open an issue if this is not the case.

nodeTwitterBot.followByTweets(phrase,[options])

Start following people by phrase in tweet.

If options is specified, then the default options(shown bellow) will be overridden.

{
  result_type: String, // Specifies what type of search results you would prefer to receive. By default : popular. You can change to recent, popular, mixed.
  count: Number, // The number of tweets to return per page, up to a maximum of 100. Defaults to 15.
}

nodeTwitterBot.followByUser(user,[options])

Start following peoply by 'user name'(should be String) in tweet.

if options is specified, the the default options(show bellow) will be overridden.

{
  count: Number, // Maximum of 5,000 per distinct request. Defaults to 15.
  file : {
    save : true, // if you would like save followers to file add true, by default it is false.
    fileName:  'file name of the file' // set filename of file
  }
}

nodeTwitterBot.unfollowAll(user,[options])

Start unfollowing people.

user can be any of the following:

  • the ID of the user for whom to return results for.
  • the screen name of the user for whom to return results for.

node-twitter-bot's People

Contributors

nikolenkoanton92 avatar

Stargazers

trashplanet avatar C J Silverio avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

gitter-badger

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.