-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkedtraget.js
37 lines (33 loc) · 1.08 KB
/
Linkedtraget.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!-- This scripts sends flooding of requests to the trageted person --!>
var countOfPagesScrolled = 0;
var searchPhrase = "Developer";
function scrollDown(height, countOfPagesScrolled){
scroll(0, document.body.clientHeight);
setTimeout(function(){
if(height != document.body.clientHeight && countOfPagesScrolled > 0){
scrollDown(document.body.clientHeight, --countOfPagesScrolled);
}else
return sendRequest();
}, 1500);
}
function sendRequest(){
var contactsNum = 0;
$.each( $('div.mn-person-card__card-actions button.mn-person-card__person-btn-ext'), function() {
$(this).each(function() {
$.each(this.attributes, function() {
if(this.specified) {
if (this.name.indexOf("data-ember-action-") >= 0){
var allInf = $("#ember"+(this.value-4)).text();
if (allInf.indexOf(searchPhrase) >= 0){
console.log($("#ember"+(this.value-4)).text());
contactsNum++;
$(this).click();
}
}
}
});
});
});
console.log('Just added contacts: ' + contactsNum);
}
scrollDown(document.body.clientHeight, countOfPagesScrolled);