Skip to content

Instantly share code, notes, and snippets.

@jhersh
Created October 30, 2012 17:32
Show Gist options
  • Save jhersh/3981726 to your computer and use it in GitHub Desktop.
Save jhersh/3981726 to your computer and use it in GitHub Desktop.
Spam likes on all posts and comments for a given Chatter user
javascript:var c=0;var s=Sfdc;var d=document;var sel="getSelection";var user=prompt("Enter User Name:",d[sel]&&d[sel]().toString()||"John Buchanan");var each=function(list,delegate){for(var i=0;i<list.length;i++)delegate(list[i])};var text=function(x){return x&&(x.textContent||x.innerText)||''};var match=function(delegate){return function(x){if(text(x)==user){delegate(x);}}};var click=function(x){if(x.style.display=='none')return;c++;x.onclick();};each(s.select(".feeditempreamble .actorentitylink"),match(function(x){each(s.select(".feeditemfooter .cxallfeedactions .cxlikeitemaction",s.Dom.getParent(x,".feeditemcontent")),click)}));each(s.select(".feedcommentuser"),match(function(x){each(s.select(".feeditemcommentbody .feedcommentactions .cxallfeedactions .cxlikecommentaction",s.Dom.getParent(x,".feeditemcomment")),click)}));alert(c+" new Likes!");undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment