Greasy Fork is available in English.

removeFacebookSuggestedPosts

Remove facebook suggested posts and games

< Feedback on removeFacebookSuggestedPosts

Question/comment

§
Posted: 10.08.2016

Add in sponsored posts as well

Sponsored posts also show up in the feed, but don't always have the "Suggested" text in the span. I mucked around (js is not my first language FYI) and seemed to have made it work, but there's likely a way better way of doing it :)


DT.main = function(){
var spans = document.getElementsByTagName("SPAN");
var totalSpans = spans.length;
for(var i = 0; i < totalSpans; i++){
var item = spans.item(i);
if(item && item.textContent === 'Suggested Post'){
var parent = item.parentNode.parentNode.parentNode.parentNode.parentNode;
if(parent){
parent.parentNode.removeChild(parent);
console.log('Removed suggested post');
}
}
if(item && item.textContent === 'Sponsored'){
var parent2 = item.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
if(parent2){
parent2.parentNode.removeChild(parent2);
console.log('Removed sponsored post');
}
}
}
};


I watched in the console and did see the second check kick in, and didn't see one post that it should have removed, so seems successful? The number of nested div's that they use is just stupid, I counted as best I could and again I think I got it right, but who knows :)

§
Posted: 11.08.2016

Works but I just saw a 'suggested game' and condensed things a bit. I don't even know javascript so please adjust as necessary :smile: The game ad seems to be super rare so I am unable to verify that part works...

DT.main = function(){ var spans = document.getElementsByTagName("SPAN"); var totalSpans = spans.length; for(var i = 0; i < totalSpans; i++){ var item = spans.item(i); if(!item) return; if(item.textContent === 'Suggested Post' || item.textContent === 'Suggested Game' || item.textContent === 'Sponsored'){ var parent = item.parentNode.parentNode.parentNode.parentNode.parentNode; if(item.textContent === 'Sponsored') parent = parent.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; if(parent){ parent.parentNode.removeChild(parent); console.log('Removed ' + item.textContent); } } } };

§
Posted: 11.08.2016

Cheers for the script additions guys! I will update the code and release a new version. It maybe a few days however as I'm now on holiday.

§
Posted: 11.08.2016
Edited: 11.08.2016

Thanks for this, those suggest posts were getting seriously annoying, but now, as previously mentioned, I saw the game suggestions right after enabling this. Looking forward to update that removes ALL those pesky ads. (like these https://i.gyazo.com/e21f3f8def26d87bad48f290dd53702a.png)
Thanks again.

§
Posted: 11.08.2016

I've just released v2 of this script, which should support removal of "Suggested Games". I've not been able to test it myself as I don't have these type of posts on my feed.

Let me know either way if this new version works for you.

Thanks again for the feedback.

§
Posted: 11.08.2016

So far, so good. Thanks for quick update/response.

§
Posted: 02.11.2017

Just created a new user script to remove sponsored posts: https://greasyfork.org/en/scripts/34722-removefacebooksponsoredposts

§
Posted: 02.11.2017

Many of the traditional channels for online content discovery are thoroughly understood and their adoption rates are high.

The readily accepted channels—from SEO and PPC, to email and social media broadcasting—can deliver the best content to the right people at the right time.

Today, however, the Internet is experiencing a deluge of content, and many channels for content discovery are bloated. Estimates say that more than 2.73 million blog posts are written and published daily. Many industries are experiencing a content surplus, making it even more challenging for marketers to get their content seen.
https://mobotak.com/Categorygrid/id/83/%D9%85%D9%88%D9%86%D9%88%D9%BE%D8%A7%D8%AF
all the best,

§
Posted: 02.11.2017

We wanted to find out the following:

An agreed upon definition for sponsored articles
The current state of sponsored articles as a channel
Examples of sponsored articles
Sponsored article pricing and value
A media buying strategy for sponsored articles
Tools and platforms for sponsored articles


We quickly learned that sponsored content on blogs and other online publications, when viewed as a marketing channel, is very immature. Pricing doesn't have much rhyme or reason, either. However, after collecting and interpreting data on 550 online properties, and dissecting countless native advertising studies, we hope to shine a light on a little-known content marketing channel.
https://mobotak.com/Categorygrid/id/1101

Post reply

Sign in to post a reply.