JS Simple Tool Example

<html>

<head>

    <title>Outbound Demo</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>

    <script>

 

        function launchSite() {

            var baseUser = document.getElementById("userID").value; //this stores the base ID as a variable

            var lines = $('#keywords').val().split(/\n/);

           

            for (var i = 0; i < lines.length; i++) {

                console.log(lines[i]);

                window.open("https://www.facebook.com/profile/" + baseUser + "/search/?q=" + lines[i], "_blank");        

 

            }

 

        }

    </script>

</head>

<body>

    Target ID: <br />

    <input type="text" id="userID" /><br /><br />

    Keywords: <br />

    <textarea rows="10" id="keywords"></textarea><br />

    <button class="btn btn-primary" onclick="launchSite()">Open Mutual Friends</button>

</body>

</html>