Skip to content

TexasBullet26/twit-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twit-Bot (Building a Twitter Bot from Node.js)


A simple Twitter bot that uses Node.js to automate tweets. Good for beginners if you want to learn some Node.js.

Goal


From the command line / terminal, how can you connect and authenticate to the Twitter API and get information such as:

  • Searching Twitter
  • Look for who has replied to you on Twitter
  • Post Tweets yourself back to Twitter
  • and much more

Make a program that will run every x minutes or x hours and post a tweet automatically based on some other type of algorithmic set of rules that you may want to make.

Use npm (node package manager) to spin up a larger Node project and use a Twitter package to connect to the Twitter API.

To run as is


  1. Clone this repository
    • Must have Git installed and in your PATH
  2. Make sure you have Node.js installed and in your PATH
  3. In your terminal, go to the location where you cloned this repository
  4. Type npm start in your terminal
    • This will run node bot.js for you, which will spit information from Twitter to your console from the conditions made in bot.js

Things to do before continuing


  • Download Node.js
  • Get it Installed
  • Figure out how to get to the command line / terminal
  • Type Node into your terminal
  • Enter some JavaScript that will run some small JavaScript program that just spits something back to the console

Next: How to use npm (node package manager) to spin up a larger Node project and use a Twitter package to connect to the Twitter API.

npm (node package manager)


How do you install an npm package?

  • npm install <package-name>

One of the things that happens when you're working on a Node project is you want to have this file called package.json.

A package.json is a file that holds your projects "settings", "configuration", and other dependencies you need to use.

Things to do before continuing


  • Create a package.json file using the npm init command in your terminal
  • npm install twit --save command saves a reference to the twit package to your package.json file as a dependency
  • Add "start": node bot.js to your scripts in your package.json file. Doing so will enable you to run npm start which will run node bot.js for you.

Glenn Lanzer III

Thank you to ttezel for creating the twit package.

About

A simple Twitter bot that uses Node.js to automate tweets. Good for beginners if you want to learn some Node.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published