shithub: werc

Download patch

ref: 1426b12c4027132e57d535af91cdac859bc1db73
parent: d9ae41f0ec801d8d95d89644f25a9920e3bf26b8
author: uriel <[email protected]>
date: Sat Jul 18 23:27:26 EDT 2009

Experimental support for Google's pubsubhubbub

--- a/apps/blagh/app.rc
+++ b/apps/blagh/app.rc
@@ -119,6 +119,12 @@
             echo 
             echo $bptext
         }> $ddir/$"n^$"bpid/index.md 
+
+        if(! ~ $"blagh_pubsubdub_hub '') {
+            # Experimental implementation of http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.1.html#anchor4
+            ifs='' { p=`{echo $req_url|sed 's/new_post$/index.atom/'|./bin/contrib/urlencode.awk }
+            hget -p 'hub.mode=publish&hub.url='^$p' $blagh_pubsubdub_hub
+        }
     }
     status=$_status
 }
--- a/apps/blagh/atom.tpl
+++ b/apps/blagh/atom.tpl
@@ -22,6 +22,10 @@
 <feed xmlns="http://www.w3.org/2005/Atom"
     xmlns:thr="http://purl.org/syndication/thread/1.0">
 
+% if(! ~ $"blagh_pubsubdub_hub '') {
+%    echo '<link rel="hub" href="'$blagh_pubsubdub_hub'" />'
+% }
+
     <link rel="self" href="%($base_url^$req_path%)"/>
     <id>%($base_url^$req_path%)</id>
     <icon>/favicon.ico</icon>