Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
/ twitter-lib Public archive
forked from airhadoken/twitter-lib

Easy Twitter API integration for Google Apps Script

Notifications You must be signed in to change notification settings

dooee/twitter-lib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Easy Twitter API integration for Google Apps Script

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%