Hey folks,
I wanted to provide an update on go-syndication (https//github.com/immanent-tech/go-syndication), a library for reading and writing RSS, Atom, JSONFeed and extensions in Go.
The biggest thing I wanted to highlight, is the introduction of a feed linter. It’s similar in functionality to a source code linter, though not quite the same. The linter in go-syndication performs both validation of a feed and reports whether it has optional features that ensure maximum compatibility and user experience. This is targeted towards the best experience in feed readers, which is the most prominent use-case for feeds. But these recommendations are always geared towards enhancing feed quality, so are universally applicable, no matter how a feed is used.
It’s worth making the distinction between validation and linting here and why its important. You can validate your feed against the RSS/Atom specification, but validation is ultimately the bare minimum needed for a feed to parse in any good reader. It won’t necessarily mean your feed is displayed in an optimum way for the end user or includes genuinely useful quality of life features. For example, items in a valid RSS feed don’t need a title if they have a description, or vice versa. Having an optional title or optional description is arguably a pretty bad experience for the consumer of your feed. So passing validation ensures your feed can be parsed, while passing all linter recommendations will ensure your feed is likely to be read. Making your feed provide a better experience for the end-users is better for everyone. Feeds become more viable alternatives to other ways of consuming content.
Currently, the linter supports linting RSS and Atom, with JSONFeed support to come! For RSS it lints against the best practices profile. For both RSS and Atom, there are also additional checks bundled into a “Go Syndication Best Practices” group, that are above and beyond the specification and recommendations and reflect modern expectations and sensibilities for feeds. In the future, I hope to set up a static web page which the linter links to, to explain each check and how to ensure your feed passes.
An online hosted version of the linter is available at https://foragd.app/linter.
The linter is extendable; you can define your own checks, group them and control which are performed. If you aren’t using Go, the command-line tool outputs JSON, which should make reading the linter output easy in any language.
To run the linter on a command-line:
```shell go run github.com/immanent-tech/go-syndication/cmd@latest lint --file=/path/to/my/feed.xml
```
I’m open to any suggestions or comments. I’d really love to know what the community thinks! Reply back here or on the go-syndication GitHub page.
Additional Links: - A deeper post about the linter - go-syndication GitHub.
submitted by /u/devopswannabe