Code Monkey home page Code Monkey logo

feedsnake's Introduction

Feedsnake

Simple Atom-to-mail (Mbox, Maildir) program: You pass it an Atom feed, it'll turn it into an mail client-friendly set of e-mails. It's pretty much feed2maildir combined with feed2mail, but less cool. It's also pretty much my attempt replacing an old project, Pogger, but for LiGNUx.

Feedsnake is scriptable, and can be easily used for one-off conversions or for managing your feed subscriptions generally. It pairs well with something like Mutt to read your feeds.

Now, I would recommend the beautiful program sfeed over Feedsnake; though Feedsnake still does work.

Usage

usage: feedsnake [-hnuU] [-s|S] [-o|d] FILE...
       feedsnake [-hn] [-c] [-s] [-o|d] URL...
       feedsnake [-h] [-s] [-o|d]

Feedsnake is a program for converting Atom feeds into mbox/maildir files.
Any Atom feeds passed as input will be output in mbox or maildir format.

If a FILE value is '-' or not provided, feedsnake will read a feed over standard
input. --since-last and similar arguments have no impact on these feeds.

If you want to subscribe to feeds with Feedsnake, you'll probably do something
like so:
       feedsnake --cache ~/feeds/hacker_news.xml \
                 --output ~/feeds/hacker_news.mbox \
                 https://news.ycombinator.com/rss

Then, to update your subscription, just run:
       feedsnake --update --since-last \
                 --output ~/feeds/hacker_news.mbox \
                 ~/feeds/hacker_news.xml

For updating all feeds:
       feedsnake --update --since-last ~/feeds/*.xml > ~/feeds/all.mbox

The FILE given as input can be any Atom/RSS file. If you'd like to update
the FILE (with --update or --update-since), then it must have the
'user.xdg.origin.url' extended attribute set as the feed URL. You can create
such a file as in the above example, by passing a URL with a --cache file set.

 -h, --help               Print a usage message
 -d, --outdir=DIR         Output directory, used for maildir output
 -o, --output=FILE        Output file, used for mbox output. Default is stdout ('-').
 -c, --cache=FILE         The cache file used if a URL is passed as argument.
 -u, --update             Update a feed FILE by downloading its newest version to the same path.
 -U, --update-since       Alias for --update and --since-last. This is probably the option you want.
 -s, --since=DATETIME     Output entries after the given date, in YYYY-MM-DD hh:mm:ss format.
 -S, --since-last         Output entries dating from the last saved parsing of the file.
 --since-update           Output entries dating from the last update of the file.
 -n, --no-save-date       Don't save parse/update time of this operation, to avoid influencing --since-*.

Installation

Feedsnake is made using Chicken Scheme, a cute little Scheme that's very friendly. Once you've got Chicken Scheme installed, you can go ahead and build Feedsnake like so:

$ sudo make dependencies
$ make client
$ sudo cp ./feedsnake /usr/local/bin/

… actually, that's somewhat of a lie. You need to manually install the xattr library first, since it's not in the egg depot.

Examples

Feeds, generally

To subscribe to a feed, you're really just creating a cache file for the feed. It's simple. Here:

$ feedsnake --no-save-date --cache ~/Feeds/Hacker\ News.xml https://news.ycombinator.com/rss

Then, just update the file and output new posts from your feed(s), every once in a while:

$ feedsnake --since-last --update --output=~/Feeds/Mail.mbox ~/Feeds/*.xml
$ mutt -f ~/Feeds/Mail.mbox

# Or, alternatively, for maildir:
$ feedsnake --since-last --update --outdir=~/Feeds/Mail/ ~/Feeds/*.xml
$ mutt -f ~/Feeds/Mail/

YouTube

I like to "subscribe" to channels by having an following its Atom feed on Invidious— it's also nice to just download those videos in one go.

Let's subscribe to a channel:

# With Feedsnake:
$ feedsnake -nc ~/Feeds/YouTube/Linsday\ Ellis.xml \
    "https://yewtu.be/feed/channel/UCG1h-Wqjtwz7uUANw6gazRw"
# Manually:
$ touch ~/Feeds/YouTube/Stop\ Skeletons\ From\ Fighting.xml
$ attr -s xdg.origin.url -V "https://yewtu.be/feed/channel/UC5Xeb9-FhZXgvw340n7PsCQ" \
       ~/Feeds/YouTube/Stop\ Skeletons\ From\ Fighting.xml

And now, lets downloading all videos uploaded since the last update:

$ ytdl $(feedsnake -U ~/Feeds/YouTube/*.xml | grep '^\*\*\*' | sed 's%^... %%')

(All URLs associated with a post are listed in the message body in a line starting with three asterisks; hence the search & removal of said asterisks.)

Meta

feedsnake's People

Contributors

jadedctrl avatar

Watchers

 avatar  avatar

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.