Skip to content

Instantly share code, notes, and snippets.

@feilongfl
Last active April 23, 2024 12:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save feilongfl/49874ebfd6671a6d356146300b34abc6 to your computer and use it in GitHub Desktop.
Save feilongfl/49874ebfd6671a6d356146300b34abc6 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