> To: [email protected]; [email protected]
> From: [email protected]
> Date: Thu, 17 May 2012 19:04:58 +0000
> Subject: Re: [PubSub] How to retrieve events from all subscribed nodes?
> 
> Thanks for your quick reply. My concern is really the timestamp. I'll have to 
> retrieve all, store them somewhere than sort by timestamp. 
> 
> 
> 
> ------Original Message------
> From: Dave Cridland
> To: Fei Yan
> To: XMPP PubSub
> Subject: Re: [PubSub] How to retrieve events from all subscribed nodes?
> Sent: May 17, 2012 1:02 PM
> 
> On Thu May 17 19:55:29 2012, Fei Yan wrote:
> > Hello,
> > 
> > For example in a RSS scenario I'm subscribed to 20 blogs (nodes). I  
> > want to retrieve the latest 20 entries (events) from all my  
> > subscribed nodes.
> > 
> > I can't find out how to do that by reading XEP60. It seems only  
> > allow retrieve from a single node at a time.
> > Fei Yan
> > Sent from my BlackBerry
> 
> Yes, you'd need to retriev all your subscriptions from the service,  
> and then iterate through that list fetching the items.
> 
> There is some interest in working on a kind of "PubSub Inbox"  
> metaphor, which would avoid this.
> 
> Dave.
> -- 
> Dave Cridland - mailto:[email protected] - xmpp:[email protected]
>   - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
>   - http://dave.cridland.net/
> Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade
> 
> 
> Fei Yan
> Sent from my BlackBerry

I would simply get a sample of 20 from each subscribed node, calculate the 
most recent 20, refetch more from the appropriate nodes as necessary until 
you know you have the 20 most recent overall.

This would reduce the amount of data you have to retrieve, assuming there
are a lot of items stored in your nodes.  If the number of items persisted is 
not
that large, then it may be simpler to simply get them all and sort it out.

If you control the server, a better solution may be to provide a custom plugin 
of
some sort that will provide you this functionality.

Robin
                                          

Reply via email to