-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblockuser.js
More file actions
56 lines (43 loc) · 1.57 KB
/
Copy pathblockuser.js
File metadata and controls
56 lines (43 loc) · 1.57 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// ==UserScript==
// @name geraspora blockuser
// @namespace gerasporablock
// @description blocksuser
// @include https://pod.geraspora.de/stream
// @version 1
// @grant none
// ==/UserScript==
var componentList = [];
// add the users you want to block in the list below
componentList[0] = "user to block";
componentList[1] = "second user to block";
$(document).ready(function() {
console.log('GreaseMonkey: Diaspora* block users');
var ms = $('#main_stream');
var msHtml = ms.html();
var msMonitoring = setInterval(function() {
var newMsHtml = ms.html();
if(msHtml != newMsHtml) {
hideDeppen();
// do not use newMsHtml cause we are inserting html in hideReshares()
msHtml = ms.html();
}
}, 1500);
function hideDeppen() {
// console.log('hide the deppen'); //collapsible.collapsed // collapsible.opened //collapsible
resharePost = $('div.stream_element:has(div.collapsible)').each(function(index, stream_element) {
//console.log('anzahl ' + index);
var se = $(stream_element);
// console.log('se: ' + se );
var originalAuthor = se.find('a.author').first().html();
//console.log('originalAuthor=' + originalAuthor);
for (var counter = 0; counter < componentList.length ; counter++) {
// console.log('component: ' + componentList[counter] + ' author: ' + originalAuthor);
if (componentList[counter] == originalAuthor)
{
console.log('drin');
se.hide();
}
}
}); // for each resharePost
} // hideReshares() end
}); // document ready