I am looking for a working example code for implementing SleekXMPP XEP 60 plugin.
What i am trying to do is
authenticate over TLS and subscribe to a node called “blogupdates”
Then simply wait for events and get the data contained in
I have searched a few days but I can’t find a good working example google or SO
note that I am not subscribing to user but a node so the publisher can be anybody.
any help?
If you look at this thread on the SleekXMPP mailing list (Beginner – SleekXMPP – XEP-0060) I have an example Pubsub client you can experiment with and examine. I’ll be tidying up and polishing those two scripts to add to the bundled examples shortly.
(EDIT: These files are now in the examples directory in the develop branch. See examples/pubsub_client.py and examples/pubsub_events.py)
For your use case, you’d do:
For more advanced usage, you can also pass:
However, if you are using the develop branch, I’ve added some newer features you may like to make it easier to deal with publish events:
For the event handlers, you can follow the pattern:
You can look at the XEP-0107 and related PEP plugins to see more examples, since these features were added to implement those.
So, here is what your use case would look like:
And finally, if you find yourself spending too much time searching on Google, please drop by the Sleek chatroom: sleek@conference.jabber.org
— Lance