buckket / twtxt

Decentralised, minimalist microblogging service for hackers.
http://twtxt.readthedocs.org/en/stable/
MIT License
1.91k stars 79 forks source link

Support for Atom/RSS feeds #88

Closed erlehmann closed 8 years ago

erlehmann commented 8 years ago

This is a 10 line patch that introduces a dependency on the Python 3 feedparser module and enables users to follow Atom/RSS feeds. It displays the title of an entry in the timeline and the link to the entry afterwards. If I am not mistaken, this enables twtxt users to follow podcasts.

erlehmann commented 8 years ago

What does “All checks have failed“ mean?

mkody commented 8 years ago

It means there was an error when testing the code.

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_parser.py _____________________
tests/test_parser.py:6: in <module>
    from twtxt.parser import make_aware, parse_iso8601
twtxt/parser.py:13: in <module>
    from feedparser import parse as parse_feed
E   ImportError: No module named 'feedparser'
====================== 14 passed, 1 error in 0.30 seconds ======================

You might need to add the module, feedparser, in install_requires: setup.py#L34

erlehmann commented 8 years ago

Added it.

buckket commented 8 years ago

As mentioned earlier (#57) I don’t want to get the core client bloated, especially not when the code is as hacky as this one. The feature should, if at all, be implemented as an optional plugin.

Furthermore I suggest reading our CONTRIBUTING.md guidelines.

Also: It’s a real bad idea to let 3rd party code decide, weather or not the input in question is an atom feed, something completely different or a twtxt file.

erlehmann commented 8 years ago

Where is the plugin infrastructure? Also: I did it using that way because twtxt seems to ignore Content-Type headers entirely.

I have created a repository for a fork that includes Atom/RSS support (and is otherwise identical): https://github.com/erlehmann/twtxt2

buckket commented 8 years ago

Well, maybe it would have been a good idea to implement support for those, instead of just trying to feed whatever input you have in every parser. As we only support consuming twtxt files checking the Content-Type hasn't been necessary so far.

Plugin infrastructure is not yet implemented.