Code Monkey home page Code Monkey logo

tweet-puppeteer's Introduction

Tweet-puppeteer

Automate posting tweets using Puppeteer and Advice Slip API which generate random advice slips.

Installation

git clone https://github.com/taheroo/Tweet-puppeteer
cd Tweet-puppeteer
npm install

Usage

node app.js --username="USERNAME" --password="PASSWORD" --schedule="SCHEDULE"

⚠️ USERNAME: Twitter account username.
⚠️ PASSWORD: Twitter account password.
⚠️ SCHEDULE: Cron schedule expression. You can generate your schedule expression using crontab guru
ℹ️ Usage example:

node app.js --username="my_twitter_username" --password="my_twitter_password" --schedule="*/2 * * * *"

This will post a new tweet each 2 minutes

Usage Result Example

alt text

Customize Posts

The application use Asvice Slip API to generate random advice posts. If you want to use another API to get posts to tweet then go to app.js file and change this default code to your way. By the end you have to store your post content to advice.data

let advice = new EventEmitter();
    request({ url: "https://api.adviceslip.com/advice", json: true }, function(
      error,
      response,
      body
    ) {
      console.log("error:", error); // Print the error if one occurred
      console.log("statusCode:", response && response.statusCode); // Print the response status code if a response was received
      console.log("body:", body.slip.advice); // Print the HTML for the Google homepage.
      advice.data = body.slip.advice;
      advice.emit("update");
    });
    advice.on("update", function() {
      console.log(advice.data);
    });

Want to help

If you like this application, please star this repository.

If you create an app using this application, please mention this repository.

If you want to contribute to this application, feel free to create a pull request.

tweet-puppeteer's People

Contributors

taheroo avatar

Watchers

James Cloos 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.