granary icon indicating copy to clipboard operation
granary copied to clipboard

XMPP PubSub

Open sjehuda opened this issue 11 months ago • 2 comments

Add support for publications that are hosted on XMPP PubSub nodes.

I have wrote a Python script which does that task.

AOX2HTML - Atom Over XMPP To HTML

  • https://portal.mozz.us/gemini/woodpeckersnest.space/~schapps/projects/aox2html.gmi
  • gemini://woodpeckersnest.space/~schapps/projects/aox2html.gmi

See also:

Rivista XJP

  • https://schapps.woodpeckersnest.eu/rivista/
  • https://video.xmpp-it.net/w/vNqcMooy3pqRAZ8Yb8grr1

[Dillo-dev] Re: XMPP PubSub Plugin

  • https://lists.mailman3.com/hyperkitty/list/[email protected]/message/AZVAIYSQG24GCNAXSSLN24KOT7HNJUJU/

sjehuda avatar Jan 08 '25 10:01 sjehuda

Hmm! I'm a fan of XMPP, but I don't know a ton about it. It uses Atom as its data format, at least for the parts that granary would handle, right? granary already supports Atom input and output. Were you hoping for some other functionality?

snarfed avatar Jan 08 '25 16:01 snarfed

It uses Atom as its data format, at least for the parts that granary would handle, right?

Yes.

See more information about it at

  • https://blasta.woodpeckersnest.eu/help/about/xmpp/atomsub
  • https://blasta.woodpeckersnest.eu/help/about/xmpp/pubsub

granary already supports Atom input and output. Were you hoping for some other functionality?

The only functionality that I expect of is to deliver XMPP PubSub node items to HTTP, as Granary does.

You can try the AOX2HTML script.

You can also try Rivista XJP, which is really a gateway to XMPP for HTTP Feed Readers.

Yet, I have managed to exted it into a publishing platform with XSLT and ECMAScript (JS), and it has no HTML, but that is for experimenting with XSLT and keeping me motivated to maintain XSLT ans CSS stylesheets to perfect appearance of feeds inside HTML browsers.

sjehuda avatar Jan 08 '25 17:01 sjehuda

The code for XMPP has a new location https://git.xmpp-it.net/sch/xmpp-for-granary, as the project Rivista has new functionalities that might not include that code.

Of course, this is not really made for Granary; it is only the XMPP code which I want to incorporate into Granary.


I will exploite this comment to mention, again, that I can do it with several hours or days, provided that you would instruct me, as you are familiar with the code of Granary.

sjehuda avatar Jul 16 '25 06:07 sjehuda

@sjehuda thanks for the nudge here!

I'd love to hear more about your use case. Are you hoping to use Atom-over-XMPP in granary yourself? Or do you know someone who would? Or do you think it's just a good fit here in general?

I don't yet have a need for it myself, so if we did add it to granary, and I had to commit to maintaining it, I'd want to know that someone actively needed and used it in granary specifically, ie with converting to/from other formats, not just as an AoX client on its own.

snarfed avatar Jul 16 '25 18:07 snarfed

@sjehuda thanks for the nudge here!

Thank you for accepting it.

I'd love to hear more about your use case.

Mostly, to use Granary as a gateway to XMPP with RSS readers that do not yet support Atom Over XMPP.

Are you hoping to use Atom-over-XMPP in granary yourself?

Yes. I am.

Or do you know someone who would?

Yes. I do.

Or do you think it's just a good fit here in general?

Yes. Indeed. That would furher make more people awaare of XMPP being a mean for publishing which would consequently increase interest and activity.

Read the message of Vladimir.

https://lists.sr.ht/~ghost08/photon/%[email protected]%3E?__goaway_challenge=meta-refresh&__goaway_id=a9d5977b990984b0d6ddd2e8b7785969

He was not aware yjat XMPP can be utilized as a publishing platform.

Once seen over Granary, more people be aware of it.

I don't yet have a need for it myself, so if we did add it to granary, and I had to commit to maintaining it, I'd want to know that someone actively needed and used it in granary specifically, ie converting to/from other formats, not just as an AoX client on its own.

I intend to use it, and I would be glad to maintain it, noth that maintenance is so necessary.

I would rather utilize Granary to follow activity and announcements over XMPP than connecting with Movim, even though Movim and also Libervia provide feeds.

sjehuda avatar Jul 16 '25 20:07 sjehuda

Interesting! Thanks for the explanation.

granary is a small library, with very few existing users besides me, in my own projects, so if you want to raise awareness of XMPP, adding it to granary won't be very effective marketing. Almost anything else would help more and give you better ROI. 😁

Mostly, to use Granary as a gateway to XMPP with RSS readers that do not yet support Atom Over XMPP.

OK! So if I understand right, you want to read XMPP channels in RSS feed readers? And you want to build and run a gateway/bridge service to make that possible? granary is definitely a good tool for that kind of thing, it's what I used in eg https://bluesky-atom.appspot.com/ and similar tools. Have you started building it yet? I'd love to see your plans and progress so far!

snarfed avatar Jul 16 '25 23:07 snarfed

Interesting! Thanks for the explanation.

Gladly.

granary is a small library, with very few existing users besides me, in my own projects, so if you want to raise awareness of XMPP, adding it to granary won't be very effective marketing. Almost anything else would help more and give you better ROI. 😁

I could argue with you about it. I have read Granary over telecommunication networks (e.g. IRC, and XMPP) time and time again in the last couple of years.

Mostly, to use Granary as a gateway to XMPP with RSS readers that do not yet support Atom Over XMPP.

OK! So if I understand right, you want to read XMPP channels in RSS feed readers? And you want to build and run a gateway/bridge service to make that possible? granary is definitely a good tool for that kind of thing, it's what I used in eg https://bluesky-atom.appspot.com/ and similar tools. Have you started building it yet?

Yes. Precisely.

I'd love to see your plans and progress so far!

You can watch the video from minute six.

https://video.xmpp-it.net/w/vNqcMooy3pqRAZ8Yb8grr1

Please ignore the "navigation bar", which is not a part of the file; it is created with an ECMAScript in order to enable a navigation interface.

  • The status of the system:

The system which I have already works and does that task. I only need to copy and paste the code into Granary.

I would want your instructions.

  • Tasks that the current system already does:
  1. The system requires the module Slixmpp;
  2. It connects to the XMPP network as a client, with an XMPP account;
  3. Upon receiving data of XMPP PEP/PubSub service (that is, only Jabber ID), it generates OPML Collection file of all Node Names;
  4. Upon receiving data of XMPP PEP/PubSub service and Node Name, it generates Atom Syndication Format file; and
  5. Upon receiving data of XMPP PEP/PubSub service, Node Name, and Item ID, it generates Atom Syndication Format file only of that item.
  • Tasks to consider:
  1. We might want to set a fixed Node Name, because the Node Name for punlishing is set to "urn:xmpp:microblogging:0" (see XEP-0277 and XEP-0472).

  2. Often, presence sharing is required in order to view content from PEP (a Pubsub service of Jabber IDs of type account), so Granary would have to send a request to view content.

sjehuda avatar Jul 17 '25 03:07 sjehuda

Sorry I neglected commans.

Original:

The system which I have already works and does that task. I only need to copy and paste the code into Granary.

Corrected:

The system, which I have, already works and does that task. I only need to copy and paste the code into Granary.

sjehuda avatar Jul 17 '25 04:07 sjehuda

Thanks for the explanations!

I'd be happy to work with you on adding this to granary. Just so you know though, it will probably be more work than just copying and pasting. granary has a specific interface that all of its formats and protocols implement, specifically from_as1 and to_as1 functions and a Source subclass that implements a number of its abstract methods. They should also generally be a single file per protocol. And for AoX specifically, we already have an atom module, which it shoould reuse as much as possible.

Check out nostr.py, it's a good recent example that does all of that. Also see the reference docs. Feel free to try if you're still interested, I'm happy to answer any questions!

snarfed avatar Jul 18 '25 03:07 snarfed

I see. I realize it.

What would be the first work for me to do?

P.S.

I did not know that Granary has capabilities other than viewing content.

  def delete(self, id):
    """Deletes a post.

sjehuda avatar Jul 18 '25 09:07 sjehuda

I'd start with the data format. See how it differs from normal Atom (if at all?), then write tests for the from_as1/to_as1 functions, then implement them.

...and if there's no difference, if it's just plain Atom, you can skip them entirely.

snarfed avatar Jul 18 '25 15:07 snarfed