Skip to content

Instantly share code, notes, and snippets.

@WouterG
Created April 3, 2015 13:24
Show Gist options
  • Save WouterG/7a89f7e9009df5b471dc to your computer and use it in GitHub Desktop.
Save WouterG/7a89f7e9009df5b471dc to your computer and use it in GitHub Desktop.
Alter PlugDJ's API
/* Add any DJ to the waitlist, allows adding yourself */
API.moderateAddDJ = function(id) {
var xml = new XMLHttpRequest();
xml.open('POST', 'https://plug.dj/_/booth/add', true);
xml.setRequestHeader('Content-Type', 'application/json');
xml.send(JSON.stringify({id: id}));
}
/* Remove any DJ from waitlist, allows removing yourself */
API.moderateRemoveDJ = function(id) {
var xml = new XMLHttpRequest();
xml.open('DELETE', 'https://plug.dj/_/booth/remove/' + id, true);
xml.setRequestHeader('Content-Type', 'application/json');
xml.send();
}
/* Delete chat of any user, including yourself */
API.moderateDeleteChat = function(cid) {
var xml = new XMLHttpRequest();
xml.open('DELETE', 'https://plug.dj/_/chat/' + cid, true);
xml.setRequestHeader('Content-Type', 'application/json');
xml.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment