Git Product home page Git Product logo

feedfilterer's Introduction

FeedFilterer

FeedFilterer allows you to write rules (JavaScript functions) that will mark feed items as read on your behalf.

Why would I ever want this?

Maybe you subscribe to a great Apple-watching blog that goes bananas over baseball from time to time (rule). Or maybe you're subscribed to several feeds that tend to link to the same stuff as each other and wish the same links didn't show up over and over (rule).

Whatever it is, FeedFilterer makes it pretty easy to exclude those items from your feed reader. The sky's the limit.

Supported feed reading services

Right now, FeedFilterer only supports FeedBin, but adding support for a new feed reading service is pretty straightforward (see Extensibility, below). Pull requests to add support for more services would be welcome.

Installation

$ npm install

Configuration

FeedFilterer reads its configuration from ~/.feedfilterer. You can find an example configuration in ExampleConfigFile.json.

Required configuration fields

The configuration file requires the following fields to be present:

client

This is the name of one of the clients in the clients directory, without the Client.js suffix. For example, if you wanted to use a client called ExampleClient.js, your configuration file's client value should be Example.

clientConfiguration

This object will be passed in to the client when it is instantiated. The fields that are required will vary from client to client, but for the FeedbinClient, it should have username and password fields.

Optional configuration fields

You can optionally include the following:

rulesPath

Specifies the location for rules to be loaded from; if this is omitted, the rules in the rules subdirectory will be loaded.

Usage

FeedFilterer is a command line tool. Once you have it set up, you have to run it periodically to clear the junk out of your feeds. (Your humble author has a cronjob set up to run it every 10 minutes during waking hours.)

Dry run (won't actually mark things as read)

$ ./feedfilterer --dry-run --verbose

For real (be careful โ€” there's no undo)

$ ./feedfilterer --verbose

Extensibility

FeedFilterer is intentionally very modular:

Adding support for new feed reading services

To add support for a new feed service, add a new subclass of FeedClient in the clients directory. Feed clients must support two methods:

  • getUnreadItems returns a Promise that is resolved with an array of FeedItems. This array should contain representations of all of the unread items in all of the feeds that the user is subscribed to.

  • markItemAsRead should accept a single FeedItem instance and mark that item as read on the feed reading service. It should return a Promise that has been resolved when the item has been marked as read.

Adding new rules to mark things as read

To add a new rule, create a new JavaScript file in your rules directory that exports a single function. This function should accept a FeedItem and return true if the item should be marked as read.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.