Skip to content
Easy Twitter API integration for Google Apps Script
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
OAuth1.gs
README.md Bump version number to 23 Feb 5, 2018
Service.gs Merge branch 'develop' into service-gs-updates Feb 4, 2017
Signer.gs Ampersand and space fix. (#10) May 21, 2016
TransientProperties.gs Alias TransientProperties as MemoryProperties May 21, 2016
Utilities.gs Utilities.gs from OAuth1 Mar 17, 2016
twitter.gs Update twitter.gs Feb 6, 2017

README.md

Twitter Lib for Google Apps Script

This library provides easy Twitter API integration for Google Apps Script. It's based on a modified version of Google's OAuth1 library, and adds convenience functions for Twitter's API endpoints and tighter properties integrations.

Use

Go to Resources -> Libraries in the Script menus, paste in MKvHYYdYA4G5JJHj7hxIcoh8V4oX7X1M_ (the project key for this script), and add in Twitterlib, version 23 (the most recent).

If you haven't generated (or can't generate) an access token pair for your Twitter app yet, paste this code into your script as well:

function authCallback(request) {
  var OAuthConfig = new Twitterlib.OAuth(PropertiesService.getScriptProperties());
  OAuthConfig.handleCallback(request);
}

To create a Twitter-authorized OAuth1 instance, use this code:

var oauth = new Twitterlib.OAuth(PropertiesService.getScriptProperties());

By convention, Twitter Lib looks for the following keys in your properties to set up authorization:

key name description
TWITTER_CONSUMER_KEY The Consumer Key for your Twitter App (this is the same for every user)
TWITTER_CONSUMER_SECRET The Consumer Secret for your Twitter App (this is the same for every user)
TWITTER_ACCESS_TOKEN The Public part of an Access Token for your Twitter App (this is different for every user)
TWITTER_ACCESS_SECRET The Secret part of an Access Token for your Twitter App (this is different for every user)
You can’t perform that action at this time.