Best example I have is a small public project for a Planet Aggregator: http://github.com/padraic/ZFPlanet
This is a PHP app using the Zend Framework. It's not all simple since the Pubsubhubbub stuff may be embedded in different places but the callbacks are standalone mostly. Since the framework includes Zend_Feed_Pubsubhubbub (waiting for the 1.10.2 release - use trunk until then) it uses that primarily (so actual mentions of PuSH are very simple library calls). Subscriptions/Unsubscriptions are tied to adding and deleting blogs to be aggregated - there's no manual subscribing but it's easy to do. Callbacks have their own controller and use Zend_Feed_Reader to parse incoming feeds (the Pubsubhubbub classes do not parse feeds and only handle the PuSH protocol itself). The callback is a basic asynchronous setup. If a feed is detected, it's written to a temp file and a script called to process it in a new system process. This let's the original callback request be completed quickly. Subscribing/Unsubscribing: http://github.com/padraic/ZFPlanet/blob/master/application/modules/admin/controllers/BlogController.php Handling Callbacks: http://github.com/padraic/ZFPlanet/blob/master/application/modules/zfplanet/controllers/CallbackController.php Zfplanet_Model_Subscription's DB Scheme (see towards end): http://github.com/padraic/ZFPlanet/blob/master/application/data/doctrine/schema/schema.yml Feel free to ping me with any questions. Alex Barth also has a non-Zend Pubsubhubbub library just released so he may also have a, er, simpler example around ;). Pádraic Brady http://blog.astrumfutura.com http://www.survivethedeepend.com OpenID Europe Foundation Irish Representative ________________________________ From: Jeff Lindsay <[email protected]> To: pubsubhubbub <[email protected]> Sent: Tue, February 23, 2010 12:47:03 AM Subject: [pubsubhubbub] Callback script examples I'm giving a SXSW talk and I'm looking to show some real-world example code for handling PubSubHubbub callbacks. I just need snippets and a description. The simpler the better. The more interesting the better. I can easily give you and your app/code/company a shoutout while showing the example. Thanks! -- Jeff Lindsay http://progrium.com
