Created
July 4, 2012 16:58
-
-
Save creotiv/3048328 to your computer and use it in GitHub Desktop.
Facebook friend adder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTMLElement.prototype.click = function() { | |
var evt = this.ownerDocument.createEvent('MouseEvents'); | |
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | |
this.dispatchEvent(evt); | |
} | |
var addFriendSuggest = function() { | |
var link = document.getElementsByClassName('uiIconText')[0]; | |
if(link.getAttribute('ajaxify')) { | |
link.click(); | |
setTimeout(addFriendSuggest,2000); | |
} else { | |
link.className = ""; | |
} | |
} | |
var addFriendSearch = function() { | |
var block = document.getElementsByClassName('FriendRequestAdd')[0]; | |
block.className = ""; | |
var link = block.getElementsByTagName('input')[0]; | |
link.click(); | |
setTimeout(addFriendSearch ,10000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment