8
\$\begingroup\$

Inspired by a conversation about annoying quirks with the chat feeds (such as New Main Posts), Feed Filter is a simple userscript I made to introduce a few features/fixes to the feeds in The Nineteenth Byte:

  • Sandboxed posts, loophole proposals, and bounties with no deadline will show their title rather than the name of the question
  • Certain posts, such as closed or duplicate questions, can be filtered out (either hidden completely or minimized to show only their title)
  • Some or all posts from feeds can be minimized or hidden using regexes

To start using the userscript, all you need to do is download it. The default configuration is pretty reasonable, but it can be changed quickly with a few simple edits.

Downloading:

Feed_Filter.user.js

Clicking the above link should automatically install the userscript (assuming you already have Greasemonkey/Tampermonkey installed).

If you already downloaded it, you may also want to ensure there is not a newer version here as you may be missing important features or bugfixes.

Usage:

The userscript shouldn't need any input from the user to begin working. By default, it has two rules programmed in:

  • Minimize any closed, duplicate, or negative score questions in the New Main Posts, New Meta Posts, or Newly Featured Questions feeds

A closed question as shown in chat feeds, but without a description or tags

  • Display as a title the first paragraph (under a certain length) of any posts in the New Sandboxed Posts, New Loophole Proposal, or New Bounties With No Deadlines feeds

A sandboxed post as shown in chat feeds, but the title is the post's title

Customization:

All customization is done by editing the userscript, by adding rules to a list at the top of the program:

const Rules = [
    {
        owners: ["New Main Posts", "New Meta Posts", "Newly Featured Questions"],
        title: /\[(closed|duplicate)\]$/,
        result: Results.MINIMIZED
    },
    {
        owners: ["New Main Posts", "New Meta Posts", "Newly Featured Questions"],
        votes: {
            max: -1
        },
        result: Results.MINIMIZED
    },
    {
        owners: ["New Sandboxed Posts", "New Loophole Proposal", "New Bounties With No Deadlines"],
        original: /^.{1,100}[\n\r]+/,
        result: Results.MODIFIED
    }
];

Each rule is formatted as an object, with a minimum of one required property: result. The rest are used to filter which feeds the rule applies to. A list of properties:

  • result: This is a required property, which can have one of four values:
    • Results.HIDDEN: The post will be entirely hidden
    • Results.MINIMIZED: The post's description and tags will not be shown
    • Results.MODIFIED: The post's title will be changed to that of the question or answer it refers to
    • Results.ORIGINAL: No changes will take place
  • owners: An optional list of names. If it exists, the rule will only apply to posts from that user (note that this can apply to non-feeds, but it will only affect references to posts)
  • votes: An optional number or object. If it is a number, the rule will only be applied if the vote count matches it exactly. If it is an object, it will use the min and max properties to determine if the rule should apply.
  • original: An optional regular expression which is applied to the displayed description before it is corrected, and will apply the rule only if it matches
  • title: An optional regular expression which is applied to the (corrected) title of the post, and will apply the rule only if it matches
  • body: An optional regular expression which is applied to the (corrected) body of the post, and will apply the rule only if it matches

Important: Only the first rule which applies to any post will be applied.

There are also additional changes you can make, such as pasting the URLs of other Stack Exchange chats into the @match field, but I'm not entirely sure if those will work properly.

Changelog

  • 1.1: Added votes filter option, as well as a default rule to minimize negative score posts

Other

If you notice any bugs, have any suggested features, or create a unique or useful set of rules, make sure to leave a comment! (I threw this together in a few hours, so I don't expect it to work perfectly :p).

Hope you like it!

\$\endgroup\$

You must log in to answer this question.

Browse other questions tagged .