How to Create Your Own Twitter Scheduler with Google Script

Twitter is a unique social networking service known for the characteristic of allowing users to share messages of upto 140 characters only. You might have noticed that celebrities and famous personalities choose Twitter over other services.

Tweeting out the right content at the right time can make a lot of differences for your business. Over the period of time you might have got to know when your followers are active and when you are getting maximum response or feedback. You might wish to tweet only on these peak hours for better reach. But it might not be possible to always be available on those time. Similarly you may like to wish your friends on his/her birthday but each and every time you might end up forgetting it.

So scheduling your Tweets is the best option to address all the above problems. Since Twitter does not have this feature you have to depend on external services. Currently there are many third party services to do this. But the concern is you might not be comfortable in giving write access to some known service. You might not know when they can turn bad. Another problem is their availability, service available now might cease to exist in future.

Introducing After Tweet:

This tool lets you create your very own Tweet scheduler. You can schedule your Twitter messages and send it your followers at any time automatically for free. The tool will entirely be controlled by you. Below are instructions how to get things started.

Create your own Twitter Scheduler – Send Tweets Automatically at Scheduled Time

Step 1: Create a Simple Twitter Application

how to create a Twitter App

  • Login to https://dev.twitter.com/ with your Twitter credentials.
  • – Give any name to the application
    – Give some description
    – Website URL can be any site.
    – Callback URL can be blank.
    – Check terms and conditions and click create your Twitter application.

  • Click on setting Permissions tab. Select read and write. Then click update settings at the bottom.
  • Click Keys and Access Tokens tab. Scroll down and click create My Access Token. Note down Consumer/API key, Consumer/API secret, Access token and secret.

Step 2: Creating After Tweet Scheduler App on Google Drive

  • Log-in to your Google Docs account.
  • Now click here to make copy of After Tweet Scheduler V3 app [Updated on Jan-18-2016] Click Yes, make a copy.
  • Wait for few seconds for the menu Tweet Scheduler to appear next to Help. Select Initialize OAuth from it. Now click continue in the authorization popup and finally click allow. In the popup that appears enter the consumer key, consumer secret, access token and secret you noted down in Step 1. Finally click Save Configuration. This is an one time process.
  • twitter-oauth-configuration

    Step 3: How to use the Application

    • All the configurations are complete now. Let’s now start scheduling the tweets.
    • Go to the Spreadsheet. Enter the Tweet text(Only 140 characters) in column B and enter Time in column C in 24 hours format like MM/DD/YYYY HH:MM. Eg., 3/30/2013 15:31. Enter twitter handle of the person whom you want to address in column A it’s optional though, whereas Tweet text and Time are mandatory.
    • Once you are done. Select Tweet Scheduler-> Schedule Tweets Now. All your Tweets will be scheduled as per the time you have given and will automatically be Tweeted from your profile at appropriate time.
    • Note: Currently you can schedule up to 20 tweets per app.
    • Make sure you set correct time zone from Tools-> Script Editor-> File-> Project properties. By default it’s set to CST.

    So, start using the After Tweet scheduler app and get productive. Reach out to the people at the time when it matters the most. Did you like the App? Stuck at any of the step? Feel free to drop in your questions and suggestions.

By Shunmugha Sundaram

Author is a Software Developer working for an MNC. He is a game and programming freak.

60 thoughts on “Introducing After Tweet: Create your Own Twitter Scheduler in Minutes”
  1. Hi,

    I see that you are using scriptdb to store and schedule the trigger based on time. Just another idea, can we skip the whole scriptdb idea and directly post to Twitter from Drive-Spreadsheet. Can you please help me in making that possible.

    Regards
    Raj

    1. Ryan,

      Currently it does not allow to post the image itself but instead you can schedule links to the images.

      Will try to add image scheduling feature if feasible. Cheers!

      1. Thank you for taking a look at that for me. I would love to be able to post pictures with a scheduler and yours is a great program.

  2. In the popup that appears enter the consumer Key and consumer Secret you noted down in Step 1

    NOWHERE DID YOU STATE IN STEP 1 TO WRITE DOWN A KEY,
    COME ON MAN

    Where do I find this key??

    1. Chris,

      Yes very much possible, requires bit of code customization though.

      Currently in IST you change timezone from Tools->Script Editor->File->Project Properties to suit your need.

  3. How can I trigger scheduleTweets every five minutes. At the moment I have to run it manually each time i update times.

    1. Select Resources-> Current project triggers-> Add new Trigger. Select scheduleTweets, set events to time driven. Finally set time you want. Hope it helps.

      Do give a like/share if this article helped you out 🙂

  4. Any way to automate more than 20 tweets? For an art project I’m looking to automate ~10000 tweets. What areas of the code need to be changed?

    Best,
    `~a

          1. You, my kind sir, are a life saver! 🙂 It’s a little bit late, so I’ll test it and spread the word tomorrow. Thank you! 🙂

  5. Now everything’s working wonderfully! 🙂 I’ve got two questions, though:

    1) Let’s say I’d want to extend the area above 20 rows so that I could leave the already sent tweets in the spreadsheet and just add new ones. Would that cause any problems? Am I correct thinking that in this situation the script would not delete the old triggers? Are there any problems I could encounter in this scenario?

    2) Is it possible to replace the “TO” column with the “in_reply_to_status_id” parameter (http://goo.gl/RKJUin) so that the tweets could exist as valid replies?

  6. Great tool, thanks for sharing. I got it to work when I manually typed in a couple of test tweets, but can’t make it work when I cut-and-paste tweets and times from Excel. The date is still in format mm/dd/yyyy hh:mm:ss and is actual dates, not equations. The tweets are all the right length. I’ve thought of a few options which I’ve tried testing:
    * it doesn’t respond when new data is entered (I tried rescheduling, still no luck)
    * it doesn’t like having more than 20 tweets pasted in the space below (deleted the extras, no luck)

    Any idea what the issue might be?

  7. I can’t get it to work, got stuck on step 2, Run AUTHORIZE. I Do everything exactly as it says, but when i go to tools -> script editor -> Run -> AUTHORIZE, it says “Authorization is required to perform that action.Dismiss” on the top of the page. Any ideas?

      1. The popup never showed, don’t know why. My workaround was to debug the function, and then the popup appeared and granted access. Now the problem is that when I run AUTHORIZE, it gives me the following message:

        “OAuthConfig API is deprecated.Collapse
        File: Techawakening_Twitter_Scheduler Line: 59
        The API has been marked as deprecated which means that the feature should be avoided and may be removed in the future. Consider using an alternative solution.
        Method UrlFetchApp.addOAuthService is deprecated.Collapse
        File: Techawakening_Twitter_Scheduler Line: 58
        The method has been marked as deprecated which means that the feature should be avoided and may be removed in the future. Consider using an alternative solution.”

        Double checked my Consumer Key and Consumer Secret, but still I can’t get it to work.. any ideas?

          1. Hi,
            I’ve been trying to make this work for me, but struggling. I don’t get the pop up after I enter the consumer key and secret.
            Any help would be appreciated.
            Thanks !

  8. Finally the popup is showed after I try to debug that function (AUTORIZED). I hope it’s help for anyone who stuck on step 2. Thanks for this tool! 🙂

    1. Looking for an updated and working version as well. Great tool, anyway you can schedule more than 20 per app?

  9. Great work indeed Shunmugha Sundaram, but am getting stuck at OAuthConfig. Since, OAuthConfig is deprecated, am unable to authorize it in the google docs and am getting this error:
    “Script is using OAuthConfig which has been shut down. Learn more at http://goo.gl/IwCSaV (line 58, file “”)”. So please help me in migrating from OAuthConfig to the OAuth1 library.

    Am not a coder, just a beginner/learner, so please give me instructions on how to migrate. I already checked: https://developers.google.com/apps-script/migration/oauth-config?utm_campaign=oauth-appsscript-315&utm_source=gadbc&utm_medium=blog but that is confusing to me.

  10. Shunmugha, the script is now broken because it depends on OAuthConfig which is no longer used (see: http://goo.gl/IwCSaV). Any chance of an update? I would love to be able to use this. Thanks!

  11. I have changed the time zone, but it the tweet is not happening to the current IST i mention.
    In script editior ->FILe-> Project properties i set time to IST
    But in script editior ->FILe->Script properties if i see time is as per the earlier time

  12. Please tell me the exact line to change the code to increase the limit of 20, tried multiple thing but no gain.

  13. Does this script to schedule tweets still works? Also, from the last comment I read that the schedule limit is only 20, is that true?

Leave a Reply to Shunmugha Sundaram Cancel reply

Your email address will not be published. Required fields are marked *