Rivista/README.md
Schimon Jehudah, Adv. 766e51af4c Modularize code;
Add packaging instructions;
Add modules to handle Gemini file type (no Gemini server yet);
Improve handling of configuration.
2024-11-12 15:25:05 +02:00

8.4 KiB

Rivista XJP

Rivista XJP ("XMPP Journal Publisher"); previously XMPP PubSub To Atom ("XPTA").

Rivista is a software that parses XMPP Pubsub Nodes and sends them as Atom Syndication Format or OPML over HTTP.

Rivista generates Atom syndication feeds (RFC 4287) from XMPP PubSub nodes (XEP-0060).

Rivista includes XSLT stylesheets that transform PubSub nodes into static XHTML journal sites.

Rivista was inspired from Tigase and was motivated by Movim.

Instances

Preview

berlin-xmpp-meetup let-s-talk-about-xmpp-tricks-with-conversations-author-daniel-gultsch-OqjaQh 59d860ab-d7c8-477c-bb4b-86924485cbbb selection

Motivation

Rivista is a syndication project which makes journals and publications that are hosted on XMPP PubSub nodes, available from HTTP to both, XML news readers and even HTML browsers.

This means that instead of hosting a journal or publication site in the old fashion (i.e. HTML documents hosted on an HTTP server), one only has to have an HTTP server to operate Rivista, and the rest of the content is delivered from an XMPP server (i.e. PubSub nodes).

The project also showcases the non-necessity of HTML, as it automatically generates valid XHTML pages by HTML browsers (client-side) from XSLT stylesheets.

Because Rivista reads XMPP PubSub nodes, it is possible to view a complete set of node items, and even a single node item, which means, that a considered and carefully earnest use of Rivista would save bandwidth and system overhead, which includes CPU, I/O and RAM usage.

Requirements

  • Python >= 3.5
  • beautifulsoup4
  • fastapi
  • lxml
  • markdown
  • slixmpp
  • tomllib (Python <= 3.10)
  • uvicorn

Installation

It is possible to install Rivista using pip and pipx.

pip inside venv

$ python3 -m venv .venv
$ source .venv/bin/activate
Install
$ pip install git+https://git.xmpp-it.net/sch/Rivista

pipx

Install
$ pipx install git+https://git.xmpp-it.net/sch/Rivista
Update
$ pipx uninstall rivista
$ pipx install git+https://git.xmpp-it.net/sch/Rivista

Configure

Add account credentials to file settings.toml.

Copy filesettings.toml to ~/.config/rivista/.

Copy directories css, graphics, img, script, and xsl to ~/.local/share/rivista/.

Copy directory json to ~/.cache/rivista/.

Start

$ rivista

Usage

It is possible to view a complete node and even a single item, which means, that it is possible to save bandwidth and it further means that a considered and carefully earnest use of this software would save system overhead, which includes CPU, I/O and RAM usage.

Viewing PubSub

Suppose you have the following PubSub nodes and items.

Jabber ID Node Item
blog.jmp.chat urn:xmpp:microblog:0 launch-2023
edhelas%40movim.eu urn:xmpp:microblog:0 working-on-launching-the-movim-network-qPBzwc
goffi%40goffi.org urn:xmpp:microblog:0 libervia-v0-8-la-cecilia-BdQ4
news.movim.eu Phoronix
pubsub.movim.eu berlin-xmpp-meetup 7363a41d-1146-40b3-ac0f-8ee2559591a3
pubsub.movim.eu berlin-xmpp-meetup let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4
pubsub.movim.eu jesus-christ-son-of-god the-passion-of-christ-redemption-and-salvation-for-all-who-believe-moSqXO
pubsub.woodpeckersnest.space PlanetJabber
pubsub.woodpeckersnest.space xmpp-it
pubsub%40sure.im news

To view pubsub nodes

http://127.0.0.1:8000/opml?pubsub=news.movim.eu
http://127.0.0.1:8000/opml?pubsub=pubsub.woodpeckersnest.space

To view node items

http://127.0.0.1:8000/atom?pubsub=edhelas%40movim.eu&node=urn%3Axmpp%3Amicroblog%3A0
http://127.0.0.1:8000/atom?pubsub=news.movim.eu&node=Phoronix
http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup
http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=jesus-christ-son-of-god
http://127.0.0.1:8000/atom?pubsub=pubsub.woodpeckersnest.space&node=PlanetJabber
http://127.0.0.1:8000/atom?pubsub=pubsub.woodpeckersnest.space&node=xmpp-it
http://127.0.0.1:8000/atom?pubsub=pubsub%40sure.im&node=news

To view a node item

http://127.0.0.1:8000/atom?pubsub=blog.jmp.chat&node=urn%3Axmpp%3Amicroblog%3A0&item=launch-2023
http://127.0.0.1:8000/atom?pubsub=edhelas%40movim.eu&node=urn%3Axmpp%3Amicroblog%3A0&item=working-on-launching-the-movim-network-qPBzwc
http://127.0.0.1:8000/atom?pubsub=goffi%40goffi.org&node=urn%3Axmpp%3Amicroblog%3A0&item=libervia-v0-8-la-cecilia-BdQ4
http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup&item=7363a41d-1146-40b3-ac0f-8ee2559591a3
http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=berlin-xmpp-meetup&item=let-s-talk-about-the-xsf-and-possibly-other-things-6A8eV4
http://127.0.0.1:8000/atom?pubsub=pubsub.movim.eu&node=jesus-christ-son-of-god&item=the-passion-of-christ-redemption-and-salvation-for-all-who-believe-moSqXO

Supported XEPs

Author

Schimon Jehudah Zackary

License

CSS and XSLT stylesheets are licensed under the license MIT.

JS scripts are licensed under the license MIT.

Python code is licensed under the license AGPL-3.0 only.

Acknowledgement

Thank you to Mr. Peter Saint-Andre (stpeter) for manifesting Atom Over XMPP.

Thank you to Mr. Wojtek and Tigase for publicly exposing an implementation of PubSub as Syndication at Sure.IM as feeds.tigase.im.

Thank you to to Mr. Timothée Jaussoin (edhelas) who consistently and earnestly showcases the potential of PubSub as a publication platform with project Movim.

A special thank you to the gentlemen "d3x" and "cchianel" from IRC channel #python on irc.libera.chat for initial references concerning code, servers and FastAPI.

And an important thank you to Mr. Simone Canaletti (roughnecks) for testing and deploying Rivista into production.

Similar Projects

  • AtomEntry and PubSubPublishViewImpl - Convert XMPP Pubsub Nodes to Atom Syndication Format and convey them over HTTP.

  • AtomToPubsub - A little client that parses Atom + RSS feeds and send them on XMPP Pubsub Nodes.

Home site