-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
41 lines (37 loc) · 1.01 KB
/
Copy pathscript.js
File metadata and controls
41 lines (37 loc) · 1.01 KB
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
38
39
40
41
function findAndClick(className) {
L = document.getElementsByClassName(className);
if(L.length > 0){
L[0].click();
}
}
function removePromoted(node){
p = node.parentNode
if(p == null){
return;
} else if (node.className == 'css-1dbjc4n r-j5o65s r-qklmqi r-1adg3ll r-1ny4l3l'){
p.removeChild(node);
return;
} else {
removePromoted(p);
}
}
function findAndRemove(className) {
L = document.getElementsByClassName(className);
if(L.length > 0){
removeParentsToDepth(L[0], 1);
}
}
function findAndRemovePromoted(){
for (const span of document.querySelectorAll("span")) {
if (span.textContent == 'Promoted'
|| span.textContent.includes('Promoted by')) {
removePromoted(span);
}
}
}
var periodic = function() {
findAndClick('css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0');
findAndClick('css-18t94o4 css-1dbjc4n r-1777fci r-1pl7oy7 r-1ny4l3l r-o7ynqc r-6416eg r-13qz1uu');
findAndRemovePromoted();
}
setInterval(periodic, 1000);