You are not logged in.

#1 2010-08-23 14:27:33

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Rss2email patched for xdg basedir adherence & KISS principles

Hey guys,
rss2email is a cool tool that fetches news feeds and sends each new post as an email.
But there are some things about it I don't like:

1) it needs a $HOME/.rss2email dir
2) it stores user config and state info in the same file, and gets automatically overwritten
3) it overcomplicates various things
4) no logging, NIH-suffering output formatting and little control over it
5) various little things, eg how it gets called and how the user must create the configuration.

So I patched it do things the way I like it. That is:
1) adherence to xdg basedir spec (no cluttering of $HOME, separation of config and state)
2) simple plaintext config, to be manually edited.  Separate state file => no more need for things like 'r2e add' , 'r2e list', etc.  No more need to use the weird numbering to refer to feeds.
3) proper wrapper script that relies on $PATH, and checks for duplicate processes => no need for file locking
4) use python logging module and have logging and debug messages configurable.

you can find my code @ http://github.com/Dieterbe/rss2email/tree/xdg

I'm not an expert python programmer, but it works fine in my experiments.  I'm planning to gradually move feeds from my old setup into the new one.

Last edited by Dieter@be (2010-08-25 20:37:09)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#2 2010-08-23 14:45:05

gtklocker
Member
Registered: 2009-09-01
Posts: 462

Re: Rss2email patched for xdg basedir adherence & KISS principles

I actually didn't know that this thing existed, it could be a good job for my future server. smile
Thanks for the patches. smile

Offline

#3 2010-08-23 23:13:02

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: Rss2email patched for xdg basedir adherence & KISS principles

Have you asked if they would be interested in merging your patches?

Offline

#4 2010-08-24 07:20:57

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

steve___ wrote:

Have you asked if they would be interested in merging your patches?

Yes, but no response yet.
Although my master branch contains some trivial improvements, my xdg branch is pretty invasive.  And I know they also target windows users.  I didn't/don't care about windows users so my branch will probably not work for them.   So probably they won't merge that.
Although coincidentally, yesterday someone patched pyXDG to work on windows.  http://lists.freedesktop.org/archives/x … 11607.html
So maybe that will work out if the windows patch gets into pyxdg, and i switch to pyXDG instead of my own functions.  Then they could merge my code and everyone would be happy.

Last edited by Dieter@be (2010-08-24 07:22:21)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#5 2010-08-26 18:45:15

zenix
Member
From: Earth - Save it!
Registered: 2007-08-05
Posts: 104
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

If I ever get off my ass, I'll finally do something about having all my feeds in GReader instead of mutt. smile

Personally, I'm aiming to use http://gwene.org/ instead of rss2email. Along with my mutt-great-dane (see AUR), I still have everything in mutt, but instead it's NNTP rather than...not. I'm not really against using rss2email, but NNTP just seems more appropriate than SMTP for news. smile

I do hope your patches will be accepted! More XDG usage, the better I think!


I made an AUR helper once.
I also go by evaryont and nogweii elsewhere on the internet.
Check out my projects and packages.

Offline

#6 2010-08-26 19:16:24

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

zenix wrote:

If I ever get off my ass, I'll finally do something about having all my feeds in GReader instead of mutt. smile

Personally, I'm aiming to use http://gwene.org/ instead of rss2email. Along with my mutt-great-dane (see AUR), I still have everything in mutt, but instead it's NNTP rather than...not. I'm not really against using rss2email, but NNTP just seems more appropriate than SMTP for news. smile

I do hope your patches will be accepted! More XDG usage, the better I think!

interesting, I don't use nntp myself though.  But what if many people add many feeds to gwene.org? does that mean everyone who syncs from gwene.org gets a lot of news (feeds) he doesn't care about?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#7 2010-08-26 19:24:13

zenix
Member
From: Earth - Save it!
Registered: 2007-08-05
Posts: 104
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

Hopefully you don't subscribe to the entire server, especially since Gmane and Gwene share the server, so you'd get a *lot* of mailing lists, too.

I'm not entirely sure how the protocol works, but each client maintains a list of newsgroups (which, with gwene, translates to an RSS/Atom feed) and requests new items. You can request a list of all of the groups but it's already HUGE.

The issue I see arising is the fact that Gwene asks the user for a newsgroup name to use for the feed. There can be a lot of duplicated effort if the feed is subscribed to many times, but different newsgroup names. Perhaps not. I haven't actually really used it, heh.

Last edited by zenix (2010-08-26 19:24:26)


I made an AUR helper once.
I also go by evaryont and nogweii elsewhere on the internet.
Check out my projects and packages.

Offline

#8 2010-09-26 10:46:39

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

I have further polished this version, and packaged it on AUR. http://aur.archlinux.org/packages.php?ID=41136
In the process, I've discoverd many more uglynesses in the original rss2email, which is now all gone.
I've been happily using this version for weeks now smile

See also http://dieter.plaetinck.be/an_rss2email … sucks_less for more info


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#9 2010-10-16 01:07:04

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: Rss2email patched for xdg basedir adherence & KISS principles

What is config.py used for?  I edited rss2email.py to change the DEFAULT_TO setting.

In the README it would be nice to explain the rss url's go in .config/r2e/feeds

Thanks for this, it is much more sane.

Offline

#10 2010-10-16 01:20:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Rss2email patched for xdg basedir adherence & KISS principles

I think you make your changes in config.py, rss2email.py has the "defaults" - it's sort of a skeleton file + the app code. This way you can have different settings for different users based on their config.py, buy I think you can do the same thing modifying rss2email.py, so it's up to you.

From the README: "DEFAULT_TO goes in config.py" :-)

Last edited by karol (2010-10-16 01:22:07)

Offline

#11 2010-10-16 02:58:16

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: Rss2email patched for xdg basedir adherence & KISS principles

Then maybe I found a bug.  Changed DEFAULT_TO in /usr/share/rss2email/examples/ and it did not work.  Come to think of it I may not have set the permissons to 755.

I also copied config.py to /usr/share/rss2email, changed DEFAULT_TO and this time i set the permissions to 755 and still no go.

Offline

#12 2010-10-16 11:09:33

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

Okay, half the info was in a readme.html (like the original rss2email) and the other half in a regular README, I fixed that now:
http://github.com/Dieterbe/rss2email/co … a44fe02b2c

@ steve___ don't modify the file in /usr/share (read `man hier`), make yourself a local config in $XDG_CONFIG_HOME/r2e/config.py (see readme)


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#13 2010-10-16 12:40:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Rss2email patched for xdg basedir adherence & KISS principles

The config.py in /usr/share/rss2email/examples/ is for you to modify, but it's best to first copy it to $XDG_CONFIG_HOME/r2e/config.py, as Dieter@be noted. If you leave it in /usr/share/rss2email/examples/ the changes won't have any effect.

Offline

#14 2010-10-16 16:34:52

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: Rss2email patched for xdg basedir adherence & KISS principles

I vote for:
# 2: Show debug messages on CLI and logfile (when enabled).
# 1: Only show messages level info and higher.
# 0: No Debug
DEBUG = 0

BODY_WIDTH = should be in config.py or else the user will have to modify /usr/bin/rss2email.py

Offline

#15 2010-10-17 10:22:51

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Rss2email patched for xdg basedir adherence & KISS principles

steve___ wrote:

BODY_WIDTH = should be in config.py or else the user will have to modify /usr/bin/rss2email.py

well, you can always put the option in config.py yourself...
But anyway, I included the html2text related options in the example config.py:
http://github.com/Dieterbe/rss2email/co … 92865b0674


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#16 2010-10-17 14:27:32

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: Rss2email patched for xdg basedir adherence & KISS principles

Oh I understand.  Thanks for all this.

Offline

Board footer

Powered by FluxBB