How to block specific news feeds on YAHOO!

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: How to block specific news feeds on YAHOO!

Post by Gingerbread Man »

Sorry, but Adblock Plus element hiding rules are limited to what CSS selectors can do. In this case, without the article source in the value of an attribute of the li element, there's no way to hide them.

You'd need a user script instead, and I haven't had time to make one. You can find an example that will remove only Huffington Post articles below. Perhaps you can ask the author of that script to modify it to remove articles from other sources as well.
https://greasyfork.org/scripts/5384-pur ... -news-feed
Maxino

Re: How to block specific news feeds on YAHOO!

Post by Maxino »

Thanks for the reply Gingerbread Man.
I'll look into it.
MacSmithTX
Posts: 9
Joined: Fri Aug 15, 2014 1:29 am

Re: How to block specific news feeds on YAHOO!

Post by MacSmithTX »

Thanks Gingerbread Man,

After figuring out how to use/load the link into Safari for Mac (NinjaKit), it works like Adblock.

Just add a new filter then copy and paste the contents of this filter into it, then change "Huffington Post" to whatever else you're wanting to block.

Really appreciate your diligence in finding this additional method for blocking unwanted feeds!
BOPRN
Posts: 2
Joined: Tue Jan 27, 2015 6:53 am

Re: How to block specific news feeds on YAHOO!

Post by BOPRN »

Gingerbread Man.

I had just posted this evening on this topic and you replied very quickly directing me here. THANK YOU!!!

I have looked for this solution for a long time, and with some quick tweaking it worked.
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

I was looking at a this thread where you interacted last year with a member about that specific issue. Trying to block the same "Dear Abby" news feed that appears under the website "news.yahoo.com". Following your previous response I looked on that "Dear Abby" page the Inspect Element with Firefox 42 on a Mac OS X !0.6.8. Once open, and after careful examination, there is no "li" element....as you described before. This means, no:" li>div>div>div>h3>a" could be found. I want also to add that no: "data-wikiids or data-attributes" could be found either under Inspect element! So I couldn't try the blocking script that you suggested last year. So, could you help me with a specific blocking script that would do the blocking job for that news feed or the Motley Fool or other undesired news feed.? I thank you in advance for your help.
Totoab57
MacSmithTX
Posts: 9
Joined: Fri Aug 15, 2014 1:29 am

Re: How to block specific news feeds on YAHOO!

Post by MacSmithTX »

The original script has been updated by the author Edward. I leave his name when using the script to give him credit.

Code: Select all

// ==UserScript==
// @name       Purge Dear Abby from Yahoo News feed
// @version    1.2
// @namespace  edward
// @author	   Edward
// @description  Eliminates Dear Abby Entries from Yahoo News list. Will run through iterative cycles to continue cleaning up the page as more are loaded.
// @include		 http*://*.yahoo.*/*
// @grant          unsafeWindow
// ==/UserScript==


setInterval(removeSpam, 2000);
function removeSpam() {
var spanTags = document.getElementsByTagName('span');
var spamNames = ['Dear Abby'];
var found;
for (var i = 0; i < spanTags.length; i++) {
  if (contains(spamNames, spanTags[i].textContent)) {
    found = spanTags[i];
    parentBlock = getParent(getParent(getParent(found)));
    removeAllChildren(parentBlock);
  }
}
}
function getParent(o) {
return o.parentNode;
}

function contains(a, obj) {
    var i = a.length;
    while (i--) {
       if (a[i] === obj) {
           return true;
       }
    }
    return false;
}
function removeAllChildren(o) {
	while (o.firstChild) {
  o.removeChild(o.firstChild);
}
	
}
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: How to block specific news feeds on YAHOO!

Post by Gingerbread Man »

Hello,
Totoab57 wrote:I was looking at a this thread where you interacted last year with a member about that specific issue. […] Once open, and after careful examination, there is no "li" element....as you described before.
Yes, we covered all that already. Like I said, you need a user script, because there's no longer any way to hide those elements with Adblock Plus.
  1. Install Greasemonkey, if you don't already have it.
  2. Go to the following link and copy all the code to the clipboard.
    https://greasyfork.org/en/scripts/5384- ... -feed/code
  3. Paste the code in a text editor like Notepad.
  4. Note the line that starts with var spamNames = . Replace the text between single quotation marks with the article sources you want to remove.
  5. Save the file as purge-yahoo-news-feed.user.js somewhere handy, like the desktop.
  6. Click and drag the file onto the Firefox window. At the Greasemonkey prompt, click the Install button.
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

Thanks Gingerbread Man,

2 questions because I am not very computer literate:
1) what is greasemonkey? is it an add-on or what else". Obviously, I do not have it installed and I have no idea about its function.
2) Do I need to copy only the first script because I am not trying to stop any spam as far as I know or do I need to copy the whole thing?

Thanks,

Totoab
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

hi,

Sorry...I had not read your answer carefully. I think I got it. I will try first to remove the "dear Abby" thread and see the results. I thank you for your prompt resply. Totoab57
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

Hi Gingerbread,

Just to make sure and avoid to screw-up anything:

I first downloaded Greasemonkey latest version and restarted Firefox v 42, then:
1) I pasted the script into Github and
2) created a file ending with: user.js
3.my remaining question is: which of the Firefox windows I drag that file into? the primary one : news.yahoo.com ? or the Dear Abby news feed, which has the following URL: http://news.yahoo.com/special-needs-dau ... 08237.html. Thanks for your anticipated help. Totoab57
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

Hi MacSmithTX,

Do you care telling me into which Firefox window of Yahoo I should drag the file containing the script you posted on this thread concerning dear Abby? Thanks. Totoab
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

pour moi,

||yimg.com/*ts/api$image
||yahoo.com/*ts/api$image
||s.yimg.com/nn/fp/rsz/101015/images/smush/*
MacSmithTX
Posts: 9
Joined: Fri Aug 15, 2014 1:29 am

Re: How to block specific news feeds on YAHOO!

Post by MacSmithTX »

After you have installed the Greasemonkey add-on to Firefox…
copy the user script above
then select New User Script from Greasemonkey menu
on the pop up window select Use Script From Clipboard
in the new window created change Dear Abby (in 3 places) to whatever you are trying to block and save
Totoab57
Posts: 28
Joined: Tue Oct 20, 2015 6:45 pm

Re: How to block specific news feeds on YAHOO!

Post by Totoab57 »

Thanks MacSmithTX,

I followed Gingerbread steps with your anti "Dear Abby" script and drag the file into the main yahoo.com page and it worked. I described the steps above, Thanks for your reply. Totoab
Brawl
Posts: 1
Joined: Tue Jan 19, 2016 4:00 pm

Re: How to block specific news feeds on YAHOO!

Post by Brawl »

Hello, is there a solution for international Yahoo news sites, such as https://de.nachrichten.yahoo.com/ ? Because I'm tired of seeing things like Business Insider and spot on...
Locked