Skip to content

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

License

Notifications You must be signed in to change notification settings

Adetona/AutoTweet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: '',

    consumer_secret: '',

    access_token: '',

    access_token_secret: ''

    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

    About

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

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Packages

    No packages published