sulami / feed2maildir Goto Github PK
View Code? Open in Web Editor NEW๐ฌ Read RSS/Atom feeds in your favourite, maildir-compatible email client.
Home Page: https://pypi.python.org/pypi/feed2maildir/
License: ISC License
๐ฌ Read RSS/Atom feeds in your favourite, maildir-compatible email client.
Home Page: https://pypi.python.org/pypi/feed2maildir/
License: ISC License
Hi,
feed2maildir is exactly what I was looking for. It works brilliantly except for two (minor but annoying problems)
mutt always shows "01 Jan 1970 01:00" as the date for the emails
the sender of messages is automatically composed into something that is difficult to read. It would be nice if this could instead be defined in the config line and/or whether the site name would be used instead
Some feed sources like Youtube have the feed.updated
out of date. It is a valid datetime but it is just old and feed2maildir
thinks that there are no more new posts.
As a workaround I'm using the newest post's time as feed time.
Hi!
I was wondering if it is possible to read a set of feeds into different maildirs? something like
{
"db": "~/.f2mdb",
{
"maildir": "~/mail/feeds1",
"feeds": {
"Commit Strip": "http://www.commitstrip.com/en/feed/",
"XKCD": "http://xkcd.com/rss.xml",
}
}
{
"maildir": "~/mail/feeds2",
"feeds": {
"Dilbert": "http://feed.dilbert.com/dilbert/daily_strip?format=xml",
"BSDNow": "http://feeds.feedburner.com/BsdNowOgg"
}
}
}
My understanding is, that this behavior is not supported? So I was wondering if you think it might be a desirable addition? Or would it be difficult to add? If you think it is desirable but don't have time to work on it, I could try myself on a PR -- but wanted to check in first before I spend any time on it.
Thanks!
I tried running feed2maildir and hit the following problem:
$ feed2maildir -c "~/DELETEME/f2md/conf"
WARNING: could not open config "['~/DELETEME/f2md/conf']"
Traceback (most recent call last):
File "/nix/store/c84bicz1xwh8xz1dmz5m0s57a6kfriij-python2.7-feed2maildir/bin/.feed2maildir-wrapped", line 50, in <module>
main()
File "/nix/store/c84bicz1xwh8xz1dmz5m0s57a6kfriij-python2.7-feed2maildir/bin/.feed2maildir-wrapped", line 45, in main
links=args['l'])
File "/nix/store/c84bicz1xwh8xz1dmz5m0s57a6kfriij-python2.7-feed2maildir/lib/python2.7/site-packages/feed2maildir/converter.py", line 76, in __init__
self.maildir = os.path.expanduser(maildir)
File "/nix/store/rnf1s3f60g7513svx51sixmcwplzbbf4-python-2.7.11/lib/python2.7/posixpath.py", line 254, in expanduser
if not path.startswith('~'):
AttributeError: 'NoneType' object has no attribute 'startswith'
The "-wrapped" part is just an artefact of me using Nix. The actual problem seems to be the argument parsing. Notice that the error message shows the config file as ['~/DELETEME/f2md/conf']
, which is a list when it should be a string.
It appears that the problem is in the feed2maildir
script, which is passing the arguments through like:
Loader(config=args['c'])
When these arguments are actually single-element lists, rather than strings (due to the use of nargs=1
).
I tried patching the script to use the first element of the list, i.e.:
Loader(config=args['c'][0])
This seems to work. I imagine similar issues would affect the other nargs=1
options -m
and -d
.
A different fix might be to change the way arguments are parsed, so they're strings to begin with, but I've not used argparse
before.
feed2maildir
fetches and parses each feed in sequence (in reader.py
) calling feedparser.parse
for each feed.
In my personal setup this takes around 24 secs to fetch and parse 23 feeds.
Using a thread pool of 4 threads to do the fetch and parse in parallel the time was reduced to 8 secs. Users with several feeds will benefit from this enhancement.
Notes:
feedparser
about thread safety. I'm assuming that it is thread safe.feedparser
seems to be IO bound so adding more threads could speed up the things even more.I will make a PR for reference.
feed2maildir
supports stripping html from the rss/atom but its abilities are limited. Currently handles images, tags and listing.
Instead of extending the built-in html stripper, feed2maildir
could allow the user to run an external program like pandoc
The proposed usage would be:
$ feed2maildir -S <program>
Note: I would use
-S
and leave-s
with the current behavior for backward compatibility.
The <program>
can be anything that can read from the standard input an html and write to standard output the stripped version of it. <program>
will be a single argument that will be interpreted by a shell command.
For pandoc
this could be called like this:
$ feed2maildir -S 'pandoc --from html --to markdown_strict'
I would like to know your opinion about this. I can prepare a pull request with the implementation.
Hi,
the tool runs great without any options, but when I use feed2maildir -s
, I get the following error message:
Traceback (most recent call last):
File "/usr/bin/feed2maildir", line 49, in <module>
main()
File "/usr/bin/feed2maildir", line 46, in main
converter.run()
File "/usr/lib/python3.7/site-packages/feed2maildir/converter.py", line 99, in run
self.write(self.compose(newfeed, newpost))
File "/usr/lib/python3.7/site-packages/feed2maildir/converter.py", line 192, in compose
desc = stripper.get_data()
NameError: name 'stripper' is not defined
I'm using the following versions:
feed2maildir 0.3.6
feedparser 5.2.1
python-dateutil 2.8.0
Python 3.7.4
Any help would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.