Read a Random Post

Introducing After Tweet: Create your Own Twitter Scheduler in Minutes

Written by

Topics: Tips & Tricks

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.

60 Comments For This Post I'd Love to Hear Yours!

  1. Raj Salecha says:

    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

    • Raj,

      Thanks for dropping by. Went with ScriptDb because there was lot of advantages when it comes to querying for data.

      As far as directly getting content from Spreadsheet you can search for the time match across the column C if there is a match you can get the corresponding entry in column A and B and post it to Twitter.

      Here is an example: http://stackoverflow.com/questions/10807936/how-do-i-search-google-spreadsheets

      Hope it helps πŸ™‚

  2. Matt says:

    Hi,

    Is this timezone specific?

    Matt

  3. Jon says:

    Hi – the test tweets I did appeared as ‘undefined’ on my timeline – any ideas?

    Jon

  4. Ryan says:

    Can I use the scheduler to post a picture?

    • 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!

      • Ryan says:

        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.

  5. duane white says:

    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??

    • Duane White,

      I have mentioned it in the last point of step 1: “Click OAuth tool tab. Note down Consumer key and Consumer secret.”

      Anyhow visit https://apps.twitter.com -> Select your app-> API keys tab. You will find the keys.

  6. Chris says:

    Any way that we can get this extended past 20 tweets scheduled? And what time zone is this tweeting off of?

    • 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.

  7. Robert says:

    Hello,

    Is this the updated version as of June 3, 2014? Thanks

  8. Topan says:

    Is this script still working? Because this didn’t work for me πŸ™

  9. Yasin says:

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

  10. Alan says:

    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

    • That’s a big number. Script may not be able to handle that many. Increase the cell range in code.

      Twitter Limitations: https://support.twitter.com/articles/15364-twitter-limits-api-updates-and-following#

  11. dkodr says:

    Any way to fix this? http://i.imgur.com/VK2pXla.jpg

  12. dkodr says:

    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?

  13. Nick says:

    Can you better explain to me how to allow for more than 20 tweets?

    Thanks!

  14. Megan Kerr says:

    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?

  15. Apolo says:

    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?

    • As shown in the screenshot there will be popup which you have to click continue button. Just checked it’s working as expected.

      • Apolo says:

        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?

      • Apolo says:

        I finally got it to work, thanks a lot!! Awesome tool!

  16. orieni says:

    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! πŸ™‚

  17. Sam says:

    Any one have updated and working copy to share ?

  18. Arun says:

    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.

  19. Julie Velghe says:

    Hi, is there a solution for this? Having the same problem

  20. Elan says:

    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!

  21. roshan says:

    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

  22. roshan says:

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

  23. Faiz says:

    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 Comment Here's Your Chance to Be Heard!