Skip to content

Instantly share code, notes, and snippets.

@PeterBerthelsen
Created January 21, 2019 16:27
Show Gist options
  • Save PeterBerthelsen/b268d97d15aaf35d5415008dc90e28f9 to your computer and use it in GitHub Desktop.
Save PeterBerthelsen/b268d97d15aaf35d5415008dc90e28f9 to your computer and use it in GitHub Desktop.
OrthoThreads Variables
function tweetThread(stringToTweet,delim,img,r){ //pass a string variable with additional option to parse (used for bookending tweets)
//////////////////////////Variables////////////////////////////////////////////////////////
var ss = SpreadsheetApp.getActiveSpreadsheet(); //spreadsheet
var twtMax = 280; //Character limit for Twitter (variable in case it changes)
var tweets = new Array(0); //create final array to populate with tweets
var total = ""; //variable for 'total' tweet-length section if parsing is required
var start = 0; //starting character for .substring() function, default 0
var excess = 0; //number of characters to strip off of 'total' to remove split words at end of tweet
var parsed = ""; //parsed tweet (total - excess) to add to tweets
var url = ""; //parsed image URLs
console.log("tweetThread initiated!"); //log function initiation
console.log("using params: " //log paramaters being passed through function
+ "|stringToTweet:" + stringToTweet
+ "|delim:" + delim
+ "|img:" + img);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment