RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.34k stars 1.03k forks source link

Add support for JSON Feed? #618

Closed Schweinepriester closed 5 years ago

Schweinepriester commented 6 years ago

First: Thanks for creating this :) And for the "Rant"-section!

Nobody seems to have requested support for JSON Feed (https://jsonfeed.org/) yet, so I thought I'd open an issue.

teromene commented 6 years ago

It could be done quite easily, but I wonder how widely is this format used in practice. Because we might not want to add a new format if no one will use it. Do you know if this format is used by any application ?

Schweinepriester commented 6 years ago

I do think its kinda a "chicken or the egg"-problem, which side supports it first? Kinda idealistic too, for the future of feeds.

Anyway, I was able to find some support:

EDIT:

I've added some quotes, indicating that JSON Feed might be a format easier to work with for some people :)

teromene commented 6 years ago

I think we could replace the current JSON feed by this, as it is currently not backed by any standard. Would anyone see any inconvenient of doing so ?

logmanoriginal commented 6 years ago

I just had a quick look at the specification, which is an interesting read. It's nice to see movement towards current generation technologies (namely JSON, which is all over the place nowadays).

The current JSON format doesn't implement any standard, it just takes the items array, encodes it and writes the JSON data to a text file. I suppose the biggest benefit of the current format is the ability to add custom fields to the items. These custom fields wouldn't be accessible via HTML, RSS or ATOM feeds. This is briefly mentioned in the Wiki.

However, the JSON Feed specification also allows custom fields to exist:

Publishers can use custom objects in JSON Feeds. Names must start with an _ character followed by a letter. Custom objects can appear anywhere in a feed.

JSON Feed - Extensions

So, the JSON format would remain as flexible as it is right now, but it would receive a proper specification that everyone could build and rely on. They even provide a validator, which is a very important factor!

Long story short, I think it is a great idea to replace the current JSON format by a proper standard. There are actually two PHP libraries listed on their site, which could make this process easier. However, in my opinion we should keep it as lightweight as possible and use them for reference without pulling in huge dependencies.

This would of course break compatibility with existing APIs (which I don't know if they even exist) that may rely on the current implementation.