-
Notifications
You must be signed in to change notification settings - Fork 2
/
LikeBuster.js
117 lines (110 loc) · 3.4 KB
/
LikeBuster.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
function logRemove(text)
{
console.log("LikeBusted: "+text+" -- Did you really want to see that?");
}
var likeBust = function() {
setInterval(function() {
jQuery('.shareFooter').remove();
jQuery('#pagelet_megaphone').remove();
jQuery('#pagelet_ego_pane').remove();
jQuery('#pagelet_trending_tags_and_topics').remove();
jQuery('div[title="Upcoming Events"],div[title="Upcoming Concerts"]').each(function(){
var li = jQuery(this).closest('li');
logRemove(li.text());
li.remove();
});
jQuery("span:contains(Recently Released Albums)").closest("li").remove();
jQuery('h6.uiStreamPassive,h5.uiStreamPassive').each(function(){
var h6 = jQuery(this);
var text = h6.text();
if ( text.match(/ claimed an offer /)
|| text.match(/ shared /)
|| text.match(/ listened to /)
|| text.match(/ like(s)? /) ) {
var li = h6.closest('li');
logRemove(text);
li.remove();
}
});
jQuery('span.uiStreamAdditionalLogging').each(function(){
var span = jQuery(this);
var text = span.text();
if (text.match(/^Sponsored$/)) {
var li = span.closest('li');
logRemove(li.text());
li.remove();
}
});
jQuery('a.pronoun-link').each(function(){
var span = jQuery(this);
var text = span.text();
if (text.match(/a link/)) {
var li = span.closest('li');
logRemove(li.text());
li.remove();
}
});
jQuery('h6 a[href*=pinterest]').each(function(){
var span = jQuery(this);
var text = span.closest('h6').text();
var li = span.closest('li');
logRemove(text);
li.remove();
});
jQuery('h5 a[href*=pinterest]').each(function(){
var span = jQuery(this);
var text = span.closest('h5').text();
var li = span.closest('li');
logRemove(text);
li.remove();
});
jQuery('h5 a[href*=tumblr]').each(function(){
var span = jQuery(this);
var text = span.closest('h5').text();
var li = span.closest('li');
logRemove(text);
li.remove();
});
jQuery('a.shareText[href*=buzzfeed], a.shareText[href*=upworthy], a.shareText[href*=medium]').each(function() {
var a = jQuery(this);
var text = a.find('strong').text();
logRemove(text);
console.log(a.closest('li.genericStreamStory'));
a.closest('li.genericStreamStory').remove();
});
jQuery('div.actorDescription').each(function(){
var span = jQuery(this);
var text = span.text();
if ( text.match(/ via /) || text.match(/ shared /) ) {
var li = span.closest('li');
logRemove(li.text());
li.remove();
}
});
jQuery('h6.uiHeaderTitle').each(function(){
var span = jQuery(this);
var text = span.text();
if ( text.match(/ You Might Like$/ ) ) {
span.closest('.ego_section').remove();
logRemove(text);
}
});
jQuery('div.uiStreamEdgeStoryLine').each(function() {
var div = jQuery(this);
var span = div.find('span.uiStreamEdgeStoryLineTx');
var text = span.text();
if (span != null && (text.match(/Similar to/) || text.match(/More From/))) {
div.closest('div').closest('div').remove();
logRemove(text);
}
});
jQuery('div.userContentWrapper').each(function() {
var div = jQuery(this);
var divtext = div.text().toLowerCase();
if (divtext.match(/coachella/) || divtext.match(/burning man/) || divtext.match(/\bplaya\b/) || divtext.match(/black rock city/)) {
div.parent().remove();
}
});
}, 200);
};
likeBust();