Git Product home page Git Product logo

twit-bot's Introduction

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 Daniel Shiffman for explaining everything so well in his videos. You can find him on Youtube and Github. Thank you to ttezel for creating the twit package.

twit-bot's People

Contributors

texasbullet26 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.