1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[GET]Javascript for sending Facebook Friend Requests

Discussion in 'FaceBook' started by Nonilol, Aug 5, 2016.

  1. Nonilol

    Nonilol Elite Member

    Joined:
    Mar 1, 2015
    Messages:
    1,645
    Likes Received:
    559
    Gender:
    Male
    Occupation:
    Media Informatics & Webdev Student
    Location:
    Hamburg, GER / Southampton, UK
    Home Page:
    Hey there,

    was looking for a Javascript that automatically clicks all 'Add Friend'-buttons it finds on a Facebook page, couldn't find any good one and decided to code one myself.
    Perfect for people like me who grow Facebook accounts by hand.


    Features:
    • Set how many friends requests you wish to send in total
    • Set delay between two friend requests
    • Overlay that shows how many friend requests have been sent already
    • Doesn't freeze the browser

    How to use:
    • Create new bookmark
    • Copy & paste the following code where you would usually put the URL
    • Click the bookmark to send friend requests

    Notice: I coded this in in just a few minutes, the code is not a good ecample for best coding practice ;)
    Tested in Chrome & Firefox. Please let me know if you encounter any bugs.



    Enjoy! :)


    Code:
    Code:
    javascript:
    var delayInput = prompt("Delay between actions (ms)", "1000");
    var stopAfter = prompt("Stop after how many friend requests are sent?", "100");
    var workDelay = parseInt(delayInput, 10);
    
    var loading = document.createElement("div");
    loading.setAttribute("id", "noni_loading");
    loading.setAttribute("style", "position: fixed; background: rgba(255,255,255,0.8); top: 0; left: 0; width: 100%; font-size: 24px; z-index: 1000; padding: 12px;");
    document.body.appendChild(loading);
    document.getElementById("noni_loading").innerHTML = "No friends added.";
    
    var inputs = document.querySelectorAll('.FriendRequestAdd:not(.hidden_elem)');
    
    
    var i=0;
    var delay=0;
    var cont=true;
    var stopAfterNumber=0;
    if(parseInt(stopAfter, 10)>inputs.length) {
        stopAfterNumber=inputs.length;
    } else {
        stopAfterNumber=parseInt(stopAfter, 10);
    }
    
    function addFriends(max){
    
        if(inputs.length<=0) {
            document.getElementById("noni_loading").setAttribute("style", "position: fixed; background: rgba(140,60,60,0.8); top: 0; left: 0; width: 100%; font-size: 24px; color: #fff; z-index: 1000; padding: 12px;");
            document.getElementById("noni_loading").innerHTML = "No 'Add Friend'-buttons found :(";
        
            alert("That didn't work...");
            document.getElementById("noni_loading").setAttribute("style", "display: none;");
        
        } else {
    
            if(workDelay <= 0) {
                delay=0;
            } else if(workDelay <= 10) {
                delay=workDelay+(Math.floor((Math.random()*5)));
            } else {
                delay=workDelay+(Math.floor(Math.random()*(0.1*delay))-(0.05*workDelay));
            }
    
            if(i<stopAfterNumber) {
                inputs[i].click();
                document.getElementById("noni_loading").innerHTML = i+" friends added. "+delay+"ms waiting...";
                cont=true;
            } else {
                document.getElementById("noni_loading").innerHTML = i+" friends successfully added!";
                document.getElementById("noni_loading").setAttribute("style", "position: fixed; background: rgba(60,140,60,0.8); top: 0; left: 0; width: 100%; font-size: 24px; color: #fff; z-index: 1000; padding: 12px;");
                cont=false;
            }
    
            i++;
            if(cont==true) {
                setTimeout(addFriends, delay);
            } else {
                alert("Success!");
                document.getElementById("noni_loading").setAttribute("style", "display: none;")
            }
        }
    }
    
    addFriends();
     
    • Thanks Thanks x 12
  2. nitoos

    nitoos Jr. VIP Jr. VIP

    Joined:
    Feb 5, 2015
    Messages:
    442
    Likes Received:
    77
    Gender:
    Male
    Can it send 500 friend requests for 1minute ?
     
  3. Nonilol

    Nonilol Elite Member

    Joined:
    Mar 1, 2015
    Messages:
    1,645
    Likes Received:
    559
    Gender:
    Male
    Occupation:
    Media Informatics & Webdev Student
    Location:
    Hamburg, GER / Southampton, UK
    Home Page:
    It will send as many friend requests as you like.
    Keep in mind sending too many friend requests in a short time might get you banned though!
     
    • Thanks Thanks x 2
  4. !nj3ct3d

    !nj3ct3d Junior Member

    Joined:
    Jun 9, 2016
    Messages:
    113
    Likes Received:
    7
    Gender:
    Male
    Random friend request?
     
  5. nitoos

    nitoos Jr. VIP Jr. VIP

    Joined:
    Feb 5, 2015
    Messages:
    442
    Likes Received:
    77
    Gender:
    Male
    Can you explain again how to use it or create short video. Thanks
     
  6. Alaindeloin

    Alaindeloin Regular Member

    Joined:
    Feb 2, 2011
    Messages:
    386
    Likes Received:
    122
    Where will he choose friend ? Could you tweak it to choose friends only in a predefined page / group ?
     
  7. bmills

    bmills Junior Member

    Joined:
    Jan 14, 2010
    Messages:
    148
    Likes Received:
    80
    Location:
    Southern California
    Home Page:
    Oooooh no jquery dependencies, thanks for this.
     
  8. Astraport

    Astraport Junior Member

    Joined:
    Jul 9, 2016
    Messages:
    103
    Likes Received:
    5
    Gender:
    Male
    Great script. Thank you. Everything works perfectly.
    But how the script processes such warnings?
    2016-08-06_10-55-15.png
    It may be necessary to add count of this windows and if there will be more than a predetermined value (eg 10), then stop adding friends as it may lead to ban an account.
     
  9. Nonilol

    Nonilol Elite Member

    Joined:
    Mar 1, 2015
    Messages:
    1,645
    Likes Received:
    559
    Gender:
    Male
    Occupation:
    Media Informatics & Webdev Student
    Location:
    Hamburg, GER / Southampton, UK
    Home Page:
    No, it simply clicks all 'add friend'-buttons it finds on the Facebook page that's currently open - in succession.

    C'mon it's not that hard, what part of the "How to" don't you understand?

    It simply clicks all 'add friend'-buttons it finds on the Facebook page that's currently open.

    Glad I could help! :)

    It doesn't process such warnings at all. Not sure what the maximum character count for a bookmark is, but I'll see if I can implement something that clicks those popups (and maybe stops after x warnings)
     
    • Thanks Thanks x 2
  10. fgdcz6

    fgdcz6 Newbie

    Joined:
    Mar 12, 2016
    Messages:
    38
    Likes Received:
    6
    Nice share OP :)
    the script is perfect for me to build some good quality accounts
    the script will shoose friends in the search page of facebook
    if you want to us it perfectly use that addon on ff or chrome and search for targeted profiles and let the script do the rest
    for the addon just type "Intelligence Search add on" in google and you will find it
     
  11. Astraport

    Astraport Junior Member

    Joined:
    Jul 9, 2016
    Messages:
    103
    Likes Received:
    5
    Gender:
    Male
    I think your script can be implemented by creating a html file on the server and running Facebook page in iframe, is not it?
    There are different kind of modal windows when friend invite, they also need to close and stop the process.
     
  12. bravekami

    bravekami Newbie

    Joined:
    Aug 6, 2016
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    perfect thank u very much for your sharing
     
  13. bravekami

    bravekami Newbie

    Joined:
    Aug 6, 2016
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    i need to ask u a question how many request should i send per day please t cant find the answare sorry for my bad english
     
  14. bravekami

    bravekami Newbie

    Joined:
    Aug 6, 2016
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    and for those warning it's always showing from the first 5 request u dont have to request hundereds requests to be shown i mean u know what Im talking about
     
  15. harishjni

    harishjni Junior Member

    Joined:
    Jul 19, 2016
    Messages:
    106
    Likes Received:
    36
    Gender:
    Male
    Great Script, can it confirm Friend Requests. I have 800 requests daily.
     
  16. bravekami

    bravekami Newbie

    Joined:
    Aug 6, 2016
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    do u really send 800 request per day ??!!
     
  17. harishjni

    harishjni Junior Member

    Joined:
    Jul 19, 2016
    Messages:
    106
    Likes Received:
    36
    Gender:
    Male
    No i get 500 to 800 Requests.
     
  18. bravekami

    bravekami Newbie

    Joined:
    Aug 6, 2016
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    ah ok tks but have u any idea about how many adding per day without the blocking of the account
     
  19. harishjni

    harishjni Junior Member

    Joined:
    Jul 19, 2016
    Messages:
    106
    Likes Received:
    36
    Gender:
    Male
    I really do not know anything about that. But i do know how to get friend requests.
    I have beautiful girl picture on my profile it always work. I post comment randomly on groups i join.
     
  20. dori92

    dori92 Regular Member

    Joined:
    Aug 6, 2013
    Messages:
    268
    Likes Received:
    96
    Occupation:
    Webmaster
    Location:
    Albania
    Home Page:
    Thanks for this script.Can i modify it to accept friend requests ?