https://github.com/tarides/river
A planet (feed aggregator) for OCaml.
https://github.com/tarides/river
Last synced: 5 days ago
JSON representation
A planet (feed aggregator) for OCaml.
- Host: GitHub
- URL: https://github.com/tarides/river
- Owner: tarides
- License: isc
- Created: 2015-03-01T16:18:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-11-08T10:30:29.000Z (8 months ago)
- Last Synced: 2025-07-04T19:14:59.744Z (11 days ago)
- Language: OCaml
- Homepage:
- Size: 12.1 MB
- Stars: 28
- Watchers: 7
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# River
[](https://github.com/kayceesrk/river/actions)
RSS2 and Atom feed aggregator for OCaml
## Features
- Performs deduplication.
- Supports pagination and generating well-formed html prefix snippets.
- Support for generating aggregate feeds.
- Sorts the posts from most recent to oldest.
- Depends on Lambda Soup for html parsing.## Installation
```bash
opam install river
```## Usage
Here's an example program that aggregates the feeds from different sources:
```ocaml
let sources =
River.
[
{ name = "KC Sivaramakrishnan"; url = "http://kcsrk.info/atom-ocaml.xml" };
{
name = "Amir Chaudhry";
url = "http://amirchaudhry.com/tags/ocamllabs-atom.xml";
};
]let () =
let feeds = List.map River.fetch sources in
let posts = River.posts feeds in
let entries = River.create_atom_entries posts in
let feed =
let authors = [ Syndic.Atom.author "OCaml Blog" ] in
let id = Uri.of_string "https://ocaml.org/atom.xml" in
let links = [ Syndic.Atom.link ~rel:Self id ] in
let title : Syndic.Atom.text_construct =
Text "OCaml Blog: Read the latest OCaml news from the community."
in
let updated = Ptime.of_float_s (Unix.gettimeofday ()) |> Option.get in
Syndic.Atom.feed ~authors ~links ~id ~title ~updated entries
in
let out_channel = open_out "example/atom.xml" in
Syndic.Atom.output feed (`Channel out_channel);
close_out out_channel
```## Contributing
Take a look at our [Contributing Guide](CONTRIBUTING.md).