All Projects → bmorelli25 → Twitter Favorite Bot

bmorelli25 / Twitter Favorite Bot

Node.js Twitter Favorite Bot

Programming Languages

javascript
184084 projects - #8 most used programming language

Twitter Favorite Bot

Read all about this project and follow the tutorial on Medium: Build a simple Twitter Bot with Node.js in just 38 lines of code

This bot returns 10 tweets for a specified search query then favorites each of the returned tweets.


How to use

  • Star and download the repository
  • run npm install to install the needed dependencies
  • Copy the file config.default.js, rename it to config.js and then change its values - this file will store the configuration details for the Twitter API.

The structure should be the following:

module.exports = {
  consumer_key: '',
  consumer_secret: '',
  access_token_key: '',
  access_token_secret: ''
}
  • Visit the Twitter API and fill out the form. When done, click on the Keys and Access Tokens tab to view your consumer key/secret and access token key/secret. Copy these keys/secrets into your config.js file.
  • In app.js you can edit the params variable to determine what to search for:
var params = {
  q: 'SEARCH_QUERY_HERE', //search query
  count: 10, //number of tweets to return
  result_type: 'recent', //shows recent tweets
  lang: 'en' //language English
}
  • Now we're ready! Open up the command prompt and type npm start to run the application.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].