passiomatic / coldsweat

Web RSS aggregator and reader compatible with the Fever API
MIT License
146 stars 21 forks source link

Fetch and show entry comments #42

Open passiomatic opened 10 years ago

passiomatic commented 10 years ago

It would be nice to track comments to a given entry and display those in the detail view. This feature should be off by default, since it creates a significant overhead to the fetch process.

The CommentAPI and Slash namescape

The CommentAPI namespace (WFW) allows to specify a related comments feed. Recent versions of WordPress support this feature, so potentially every WP installation has this information already available:

<rss version="2.0"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    >
       ...

So for a given feed entry we have the corresponding feed URL:

<wfw:commentRss>http://redpunk.com/articoli/su-vice-com-un-commento-che-merita/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>

Also note the slash:comments specifiy the numbers of comments. This information could be used to avoid to keep fetch empty comments feeds.

Feedparser recognizes both WFW and Slash namespaces so extract values is trivial.

Where to show the comments

Comments should not mess up unread, saved, etc. lists in the aggregator app nor in the web reader. An idea is to append the comments as an HTML list after the entry content before serving the entry via Fever or web reader.

Changing the database schema

Should comments be stored in a dedicated "comments" table, with a reference to the parent entry along with author and timestamp information? Aren't comments entries too?

What to do with the comment feeds?

Should Coldsweat add the comment feeds to its database? This creates a number of feeds which soon become inactive since people are unlikely to comment older entries. Discussion on an entry naturally dies after few days.

More References