Skip to content

Instantly share code, notes, and snippets.

@eeejay
Created March 27, 2014 23:10
Show Gist options
  • Save eeejay/9821196 to your computer and use it in GitHub Desktop.
Save eeejay/9821196 to your computer and use it in GitHub Desktop.
<html>
<body>
<a href="" id="bookmarklet">Bookmark this link</a>
<script>
function bookmarklet() {
var pid = /profile_id=(\d*)&/.exec(document.querySelector("[href*=\"profile_id=\"]").href)[1];
var uid = prompt("Paste here Facebook ID:", "ID");
if (((uid * 2) / 2) != uid) {
alert("Incorect number.");
halt;
};
(function anonymous() {
(new Dialog({
postURI: ["/ajax/pages/fanlist/mutator.php", true],
title: {
__html: "Remove " + uid + " from this page?"
},
body: {
__html: "<div>You sure you want ban?<input type=\"hidden\" autocomplete=\"off\" name=\"act\" value=\"confirm_remove\" /><input type=\"hidden\" autocomplete=\"off\" name=\"page_id\" value=\"" + pid + "\" /><input type=\"hidden\" autocomplete=\"off\" name=\"user_id\" value=" + uid + " /></div>"
},
buttons: ["ok", "cancel"],
buttonsMessage: "<label class=\"uiCheckbox\" for=\"u200232_1\"><input type=\"checkbox\" name=\"unban\" id=\"u200232_1\" /> Ban permanently</label>",
secure: true
})).show();
})()
}
document.getElementById('bookmarklet').href = 'javascript:' + encodeURI(bookmarklet.toString() + '();');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment