Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackjackk/d46b781abbc6823c18a0cf05c818fe25 to your computer and use it in GitHub Desktop.
Save jackjackk/d46b781abbc6823c18a0cf05c818fe25 to your computer and use it in GitHub Desktop.
var huginn = window.location.protocol + "//" + window.location.host
var auth_key = document.getElementsByName("csrf-token")[0].content;
for (var a in window.agentPaths) {
var url = huginn + window.agentPaths[a].match(/\/agents\/\d+/)[0] + "/remove_events"
console.log(url)
$.post(url,"_method=delete&authenticity_token=" + auth_key,function(data,success,xhr){
console.log("finish",url)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment