I'm working on a Collecta XMPP ap in PHP ( something I haven't seen
any example code for yet, so when I get it running I plan on writing a
tutorial ) and I'm running into some elementary issues.
Since there does not seem to be an adequate PHP library for pubsub,
I'm working from the base level and opening socket connections myself.
I'm connecting to Collecta fine at this point, but every time I try to
subscribe to a search query using the examples provided by Collecta I
get an "invalid-namespace" error.
The data I'm sending is as follows:
<iq type='set' from='sea...@postling.com' to='search.collecta.com'
id='sdfsafsd'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe jid='sea...@postling.com' node='search'/>
<options>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#subscribe_options</value>
</field>
<field var='x-collecta#apikey'>
<value>".COLLECTA_API_KEY."</value>
</field>
<field var='x-collecta#query'>
<value>earthquake</value>
</field>
</x>
</options>
</pubsub>
</iq>
And the response I get is:
<?xml version='1.0'?><stream:stream xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' id='2007589065'
from='collecta.com' xml:lang='en'><stream:error><invalid-namespace
xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error></
stream:stream>
I suspect I'm either missing a required XML prefix of some kind or
I've got the ID / JID stuff all wrong ( or both ), but I figure you
folks will be able to point me in the right direction.
Hi folks,
Those are excellent questions, as I'm still trying to figure out what
would be best in this scenario.
What I'm trying to do is something like the following:
1. Users on Postling.com set up saved search queries ( generally to
monitor discussion about their businesses, looking something like
"Joe's Pizza Place" )
2. Postling maintains a connection to Collecta, monitoring the stream
as it comes in and caches the results in our database
3. Users can then view the results to their saved searches streaming
in on Postling, and have a historical record of results since they set
up the query
I *think* what would be best would be to set up an XMPP server on
Postling's side to connect to Collecta and manage all of the
connections / queries directly between the two sites. This server is
not yet written, and this is the beginning of my explorations into
creating one.
In essence, I want to build a system that subscribes to multiple
search queries through Collecta and caches all of the results as they
come in. What method do you think would be best to accomplish such a
thing?
On Feb 22, 11:16 am, Christopher Zorn <christopher.z...@gmail.com>
wrote:
> On Mon, Feb 22, 2010 at 10:51 AM, Chris Maguire <chris.magu...@gmail.com>wrote:
>
>
>
>
>
> > Hi folks,
>
> > Hello Chris. I have a few questions below.
> > I'm working on a Collecta XMPP ap in PHP ( something I haven't seen
> > any example code for yet, so when I get it running I plan on writing a
> > tutorial ) and I'm running into some elementary issues.
>
> > Since there does not seem to be an adequate PHP library for pubsub,
> > I'm working from the base level and opening socket connections myself.
> > I'm connecting to Collecta fine at this point, but every time I try to
> > subscribe to a search query using the examples provided by Collecta I
> > get an "invalid-namespace" error.
>
> > The data I'm sending is as follows:
>
> > <iq type='set' from='sear...@postling.com' to='search.collecta.com'
> > id='sdfsafsd'>
> > <pubsub xmlns='http://jabber.org/protocol/pubsub'>
> > <subscribe jid='sear...@postling.com' node='search'/>
Hi Chris, thanks for replying!
Those are excellent questions, as I'm still trying to figure out what
would be best in this scenario.
What I'm trying to do is something like the following:
1. Users on Postling.com set up saved search queries ( generally to
monitor discussion about their businesses, looking something like
"Joe's Pizza Place" )
2. Postling maintains a connection to Collecta, monitoring the stream
as it comes in and caches the results in our database
3. Users can then view the results to their saved searches streaming
in on Postling, and have a historical record of results since they set
up the query
I *think* what would be best would be to set up an XMPP server on
Postling's side to connect to Collecta and manage all of the
connections / queries directly between the two sites. This server is
not yet written, and this is the beginning of my explorations into
creating one.
In essence, I want to build a system that subscribes to multiple
search queries through Collecta and caches all of the results as they
come in. What method do you think would be best to accomplish such a
thing?
I'll almost certainly write back again when we get stuck later on ;D
-chris
On Feb 22, 7:53 pm, Christopher Zorn <christopher.z...@gmail.com>
wrote:
> There is also a python implementation of s2s in a library called wokkel.http://wokkel.ik.nu/
>
> Here is a ping example that you can modify to do pubsub requests to
> Collecta.
>
> > > > xmlns:stream='http://etherx.jabber.org/streams'id='2007589065<http://etherx.jabber.org/streams%27id=%272007589065>