Created
July 1, 2019 15:02
-
-
Save bdunnette/123431793c35d72a36cdabad63b7f677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function postToot(text) { | |
host_instance = 'https://botsin.space' | |
token = 'your-token-goes-here' | |
var data = { | |
'status': text, | |
'visibility' : 'public' | |
}; | |
var options = { | |
'method' : 'post', | |
'headers':{'Authorization':'Bearer ' + token}, | |
'contentType': 'application/json', | |
'payload' : JSON.stringify(data) | |
}; | |
var response = UrlFetchApp.fetch(host_instance + '/api/v1/statuses', options); | |
Logger.log(response.getContentText()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment