Skip to content

sutimurturkan/twitter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

twitter-bot

A simple twitter bot with Node.js, just for fun.

  • Functionality to automatically like certain number of tweets that match a desired keyword.

Configuration

Create a Twitter app from Twitter and retrieve your API keys.

// Initialize twit and file system modules
var Twit = require('twit');
var fs = require('fs');

// Enter your unique API keys
var TWIT_CONSUMER_KEY = '';
var TWIT_CONSUMER_SECRET = '';
var TWIT_ACCESS_TOKEN = '';
var TWIT_ACCESS_TOKEN_SECRET = '';

// Data file
var DATA = "data.txt";

// Set search key
var SEARCH_KEY = '#javascript';

// Max no of tweets
var MAX = 10;

// Do not make the time too short
var TIMER = 5*60*60*1000; // 5 hrs

Adjust your query:

var query = {
    q: SEARCH_KEY,
    result_type: "recent",
    lang: 'en',
    count: MAX
  }

Dependencies

You can run this command to install all:

npm install

Usage

Run the following command to start bot running

npm start

About

A simple twitter bot with Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published