Skip to content

Instantly share code, notes, and snippets.

@naosim
Created March 1, 2023 09:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naosim/d61e5a200c1b5de3878a283acdf1fe18 to your computer and use it in GitHub Desktop.
Save naosim/d61e5a200c1b5de3878a283acdf1fe18 to your computer and use it in GitHub Desktop.
GoogleAppsScriptでMisskeyに投稿する
/**
* @param {string} text
* @param { {server: string, token: string} } options options.serverはたとえば"misskey.io"
*/
function postToMisskey(text, options) {
return UrlFetchApp.fetch(
`https://${options.server}/api/notes/create`,
{
'method': 'POST',
'headers' : {'Content-Type': 'application/json'},
'payload':JSON.stringify({i : options.token, text: text})
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment