Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local headers = {}
- local key = "PRIVATEAPIKEY"
- headers = {
- [ "Content-Type" ] = "application/json",
- [ "User-Agent" ] = "Testing"
- }
- local tbl = [[{comment: {text: "what kind of idiot name is foo?"},
- languages: ["en"],
- requestedAttributes: {TOXICITY:{}} }]]
- --tbl = textutils.serialise(tbl)
- local res = http.get("https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key="..key,tbl,headers)
- print(res.getResponseCode())
- file = fs.open("/log","w")
- file.write(res.readAll())
- file.close()
Add Comment
Please, Sign In to add comment