Created
February 1, 2020 02:05
-
-
Save easrng/d205eebcb3896e76fa15421471cd5ca7 to your computer and use it in GitHub Desktop.
Reverse-Engineering the Grammarly Affiliate API
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
async function gcheck(text){ | |
let f=new URLSearchParams() | |
f.set("aff_id","1122") | |
f.set("offer_id","41") | |
f.set("source","gc") | |
f.set("aff_sub","gceditor") | |
f.set("text",text) | |
return JSON.parse(atob(r=new URL((await (await fetch("https://irbis.grammarly.com/api/funnels/embedded/check", {"credentials":"omit","headers":{"accept":"*/*","accept-language":"en-US,en;q=0.9","content-type":"application/x-www-form-urlencoded; charset=UTF-8","sec-fetch-mode":"cors","sec-fetch-site":"cross-site"},"referrer":"https://www.grammarcheck.net/editor/","referrerPolicy":"no-referrer-when-downgrade","body":f.toString(),"method":"POST","mode":"cors"})).json()).reportUrl).searchParams.get("alerts"))) | |
} | |
await gcheck(`stuffs and things go here!`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment