Skip to content

Instantly share code, notes, and snippets.

@ku
Created February 25, 2012 20:53
Show Gist options
  • Select an option

  • Save ku/1910676 to your computer and use it in GitHub Desktop.

Select an option

Save ku/1910676 to your computer and use it in GitHub Desktop.
nengapoke
var a=null;;$x("//ul/li//a/@data-profileid").filter(function (n) {return /*n.nodeValue == ""*/ true} ).map(function(n){
var profile_id = n.nodeValue;
if (a) document.body.removeChild(a)
a = document.createElement("a");
a.id = "pb-" + profile_id;
a.setAttribute("ajaxify", '/ajax/pokes/poke_inline.php?uid=' + profile_id + '&name=dummy');
a.setAttribute("rel", "async-post");
a.appendChild( document.createTextNode("Poke"));
document.body.appendChild(a);
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
a.dispatchEvent(evt);
return profile_id
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment