Sirshark10

Perspective

Oct 31st, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. local headers = {}
  3. local key = "PRIVATEAPIKEY"
  4.  
  5. headers = {
  6.     [ "Content-Type" ] = "application/json",
  7.  [ "User-Agent" ] = "Testing"
  8. }
  9. local tbl = [[{comment: {text: "what kind of idiot name is foo?"},
  10. languages: ["en"],
  11. requestedAttributes: {TOXICITY:{}} }]]
  12.  
  13.  
  14. --tbl = textutils.serialise(tbl)
  15. local res = http.get("https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key="..key,tbl,headers)
  16. print(res.getResponseCode())
  17. file = fs.open("/log","w")
  18. file.write(res.readAll())
  19. file.close()
Add Comment
Please, Sign In to add comment