Skip to content

Instantly share code, notes, and snippets.

@athlan
Last active October 19, 2015 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athlan/11160066 to your computer and use it in GitHub Desktop.
Save athlan/11160066 to your computer and use it in GitHub Desktop.
Facebook Like birthday wishes
/**
* Script to like all birthday wishes on timeline
* By Piotr Pelczar
*
* Usage:
* 1. Activate programming console in Google Chrome (F12)
* 2. Go to the console tab
* 3. Expand all wishes list (see more) as it reach end
* 4. Copy this script, paste and hit ENTER
* 5. MAGIC HAPPENS!!! Massive amount POST like requests are sent to Facebook
*/
document.getElementsByClassName('contentAfter')[0].getElementsByClassName('UFILikeLink')
function eventFire(el, etype){
if (el.fireEvent) {
(el.fireEvent('on' + etype));
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
for(var i = 0, j = a.length; i<j; ++i) if(a[i].title == 'Like this') eventFire(a[i], 'click');
@david-sim
Copy link

Uncaught TypeError: Cannot read property 'getElementsByClassName' of undefined(…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment