Neutral Political Machine

autotweet

1.1.0 • Public • Published

AutoTweet

AutoTweet is a Twitter bot that helps with tweeting at a scheduled time.

Quick start

Tools needed to set up AutoTweet:

  • Node.js installed on your machine.
  • A registered Twitter account.
  • A Twitter App - Create one for your Twitter account here
  • Note: The following processes below assumes you have set up all the tools above

    Setting up on your local machine.

  • Open your Terminal, cd to the directory where you want to install the script.
  • git clone https://github.com/Adetona/AutoTweet.git to download the script to your machine Or simply run npm install autotweet to install via npm
  • Open config.js file. You will find the following in the file:
  • consumer_key: '65EmpGTOKXXkjHR9tI5Jiio01',

    consumer_secret: 'FZ0lYU5dUJA4YTuqPtZ4q5NfXLbXFuz4E9xgA49ij6Tc8YAcol',

    access_token: '2963547257-9N7VF9O9gLjQQTtJhRVjk8chJQivg0zTMV2dy9E',

    access_token_secret: 'QMnRuSd0zbh3HbZ09wcVUohOEAol5W6HrABPyNF0gf0fY'

    Change the hash values to those provided to you by the Twitter app.

    Scheduling your tweet.

  • Open the server.js file.
  • Set the value of var tweet to the tweet you want to schedule.
  • var tweet = ['12:22 AM'];

  • Set the value of cycle to the time you want to post the tweet. The current time in the script is 12:22 AM.
  • Learn more about setting the right time here

    cycle: '12:22:00'

    Test the script.

  • After the configuration, you should cd to the directory where the script is located, then type node server.js in your terminal and run it
  • If your configuration is complete the tweet will be posted to your account at the scheduled time.

    Deploying to Heroku

    If you want the script to be running continuosly you have to move it to a server.

    Provided you have an Heroku account and Heroku CLI installed on your machine you can easily deploy AutoTweet to heroku.

  • npm install autotweet to download the script.
  • Heroku create to create the name for the app on heroku
  • git add . and git commit -m 'initial commit' to stage the file for deploying.
  • Now you can push the whole project to the heroku by running git push heroku master
  • Now that you've pushed the project to heroku there's one more thing to check.

    Go to your heroku dashboard and click on your app name. You will see some set of tabs, click on Overview then go to configure dynos. You will have two options -- Web and Worker. The web part means that the app is a web service but our app is a bot so turn off the web and turn ON the worker instead. Your bot won't work without completing this process.

    The final process must look like this:

    Congratulations, you did it!

    You can get in touch with me via my twitter handle @adetona77

    Keywords

    none

    install

    npm i autotweet

    Downloadsweekly downloads

    0

    version

    1.1.0

    license

    ISC

    last publish

    collaborators

    • avatar
    Report a vulnerability