getSynonyms
code:Tampermonkey用.js
// ==UserScript==
// @name New Userscript
// @version 0.1
// @description try to take over the world!
// @author You
// @grant GM_xmlhttpRequest
// ==/UserScript==
;(function () {
"use strict"
unsafeWindow.getSynonyms = (word) => {
return new Promise((r) => {
GM_xmlhttpRequest({
method: "GET",
url,
headers: {"X-RapidAPI-Key": "YOUR API KEY HERE"}, //ここに自分のAPI Keyを入れてください
onload: (res) => r(res),
withCredentials: true,
responseType: "json",
})
})
}
// Your code here...
})()