--
Jeff Lindsay
http://webhooks.org -- Make the web more programmable
http://shdh.org -- A party for hackers and thinkers
http://tigdb.com -- Discover indie games
http://progrium.com -- More interesting things
I need to put together two "best practices" wiki pages, one for
subscribers and another for publishers. Questions like this would go
in there.
The "callback" URL for a subscriber is supposed to be a real callback,
i.e., a pure closure like in functional programming
(http://en.wikipedia.org/wiki/Closure_%28computer_science%29). That
means you can encode whatever you want in the callback URL. You can
even make these parameters secure by signing them or encrypting them.
For example, in your case:
> <?xml version="1.0" encoding="utf-8"?>
> <rss version="2.0">
> <channel>
> <title>julien timeline</title>
> <link>http://identi.ca/julien</link>
> <link href="http://identi.ca/main/sup#3429" xmlns="http://www.w3.org/
> 2005/Atom" type="application/json" rel="http://api.friendfeed.com/
> 2008/03#sup"/>
> <description>Updates from julien on Identi.ca!</description>
> <language>en-us</language>
> <ttl>40</ttl>
>
> <item>
> <title>julien: Testing something!</title>
> <description>Testing something!</description>
> <pubDate>Sun, 12 Jul 2009 01:21:02 +0000</pubDate>
> <guid>http://identi.ca/notice/6341652</guid>
> <link>http://identi.ca/notice/6341652</link>
> </item>
>
> </channel>
> </rss>
>
>
> As a subscriber, I can only identify the URI of the feed only if I
> keep a "mapping" of feed URIs <-> source URIs (http://identi.ca/julien
> in that specific case).
What's your subscriber URL? Why not make it something like:
http://yoursubscriber.com/subscriber/julien/identica/<hmac signature>
Then you know exactly what you need to know. You have a handle to the
original feed with the already parsed information that your subscriber
requires. You could use paths like I did above, or you could append
the whole original feed as a URL. It's up to you to integrate it with
your existing web-hook handlers however you want.
Is this good enough for what you're trying to do? However, that said I
think putting the original canonical source URL somewhere the request
(as a header probably) could work just because the most common case is
people wanting this value. There's no point in making all subscribers
construct their callbacks correctly.
For Jeff: I think giving people these "web-hook closures" is the way
to go for all web-hooks. People like to do things differently. Some
people like to use parameters, some people like "pretty" paths, others
want to include some other information so their web-hook handlers can
be completely stateless.
-Brett
Yet, I know that the hub fetched this feed itself, so the hub has its
URI, and I think it should pass it to the subscribers.
The "callback" URL for a subscriber is supposed to be a real callback,
i.e., a pure closure like in functional programming
When you say webhook closures, do you just mean that you pass along
whatever query string was included when you register the callback
webhook?
-jeff
--
Just to finish this thread, I agree with you guys that the query
params should be preserved. I'm tracking this in this issue: