Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7650855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:21:35+00:00 2026-05-31T11:21:35+00:00

I am looking for a working example code for implementing SleekXMPP XEP 60 plugin.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:21:37+00:00Added an answer on May 31, 2026 at 11:21 am

    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:

    xmpp['xep_0060'].subscribe('pubsub.example.com', 'blogupdates')
    

    For more advanced usage, you can also pass:

    bare=False
    # Subscribe using a specific resource, and not the bare JID
    
    subscribee='somejid@example.com'
    # Subscribe a different JID to the node, if authorized
    
    options=data_form
    # Provide subscription options using a XEP-0004 data form
    

    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:

    # Generic pubsub event handlers for all nodes
    xmpp.add_event_handler('pubsub_publish', handler)
    xmpp.add_event_handler('pubsub_retract', handler)
    xmpp.add_event_handler('pubsub_purge', handler)
    xmpp.add_event_handler('pubsub_delete', handler)
    
    # Use custom-named events for certain nodes, in this case 
    # the User Tune node from PEP.
    xmpp['xep_0060'].map_node_event('http://jabber.org/protocol/tune', 'user_tune')
    xmpp.add_event_handler('user_tune_publish', handler)
    # ...
    # The same suffixes as the pubsub_* events.
    # These events are raised in addition to the pubsub_* events.
    

    For the event handlers, you can follow the pattern:

    def pubsub_publish(self, msg):
        # An event message could contain multiple items, but we break them up into
        # separate events for you to make it a bit easier.
        item = msg['pubsub_event']['items']['item']
        # Process item depending on application, like item['tune'], 
        # or the generic item['payload']
    

    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:

    # Note that xmpp can be either a ClientXMPP or ComponentXMPP object.
    xmpp['xep_0060'].map_node_event('blogupdates', 'blogupdates')
    xmpp['xep_0060'].add_event_handler('blogupdates_publish', blogupdate_publish)
    xmpp['xep_0060'].subscribe('pubsub.example.com', 'blogupdates')
    # If using a component, you'll need to specify a JID when subscribing using:   
    # ifrom="specific_jid@yourcomponent.example.com"
    
    def blogupdate_publish(msg):
        """Handle blog updates as they come in."""
        update_xml = msg['pubsub_event']['items']['item']['payload']
        # Do stuff with the ElementTree XML object, update_xml
    

    And finally, if you find yourself spending too much time searching on Google, please drop by the Sleek chatroom: sleek@conference.jabber.org

    — Lance

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have been looking around to find some nice working example of implementing Membership
Hi there i am looking for a working example on how to integrate and
I’m working on some expression tree code written by a colleague and am looking
I have been working with the example code from the ExecutorCompletionService and put together
I'm looking for a working example of a Magento API-enabled module. How can I
I am looking for a very short working example of flex and bison with
I've been looking at the wiki page: http://en.wikipedia.org/wiki/Shunting-yard_algorithm I've used the code example to
I'm looking for one of either 2 things 1 - A working example of
I'm looking into using a IOC container but I'm working with legacy code and
I am looking to start working on a personal site using C#. I work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.