README: improve documentation - pubsubhubbubblub - pubsubhubbub client implementation
HTML git clone git://git.codemadness.org/pubsubhubbubblub
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit e62f5cc6b38cd2f629b639699678e248a456d3e1
DIR parent 942b1e6bd013eee6321334f11651e3982e491d83
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 28 May 2022 12:36:25 +0200
README: improve documentation
Diffstat:
M README | 47 ++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 17 deletions(-)
---
DIR diff --git a/README b/README
@@ -42,8 +42,8 @@ Files
pubsub_cgi.c - Small stupid PubSubHubBub implementation as a CGI program.
pubsub_gethub - Helper program extract a hub and feed URL from a RSS or Atom feed data.
pubsub_setup - Helper script that sets up the directory structure for
- processing the feed for the CGI program. It has an
- -s option to subscribe and an -u option to unsubscribe at a hub also.
+ processing the feed for the CGI program. It has an -s option to
+ subscribe and an -u option to unsubscribe at a hub also.
How to install
@@ -85,17 +85,19 @@ The CGI program https://codemadness.org/pubsub/slashdot/secrettoken
Directory structure:
-/pubsub-data/config/feedname/ - Directory with metadata about the feed.
-/pubsub-data/config/feedname/hub - The hub URL, for example http://pubsubhubbub.appspot.com/ .
-/pubsub-data/config/feedname/topic - hub.topic, the feed URL.
-/pubsub-data/config/feedname/secret - hub.secret for calculating the message digest,
- see Section 8 of Pubsubhubbub core 0.4 (optional).
-/pubsub-data/config/feedname/token - File containing a line with a secret token. This makes sure an entrypoint
- is not easy guessable by different hubs etc (optional).
-/pubsub-data/feeds/feedname/ - Directory containing processed messages.
-/pubsub-data/tmp/feedname/ - Temporary directory to process messages.
- Moves to the feeds/feedname directory on success.
-/pubsub-data/log - Log file, TAB-separated.
+/pubsub-data/config/feedname/ - Directory with metadata about the feed.
+/pubsub-data/config/feedname/callback - The hub.callback URL used to subscribe.
+/pubsub-data/config/feedname/hub - The hub URL, for example http://pubsubhubbub.appspot.com/ .
+/pubsub-data/config/feedname/topic - hub.topic, the feed URL.
+/pubsub-data/config/feedname/secret - hub.secret for calculating the message digest,
+ see Section 8 of Pubsubhubbub core 0.4 (optional).
+/pubsub-data/config/feedname/token - File containing a line with a secret token. This makes
+ sure an entrypoint is not easy guessable by different
+ hubs etc (optional).
+/pubsub-data/feeds/feedname/ - Directory containing processed messages.
+/pubsub-data/tmp/feedname/ - Temporary directory to process messages.
+ Moves to the feeds/feedname directory on success.
+/pubsub-data/log - Log file, TAB-separated.
Example
@@ -109,18 +111,24 @@ Get the hub and feed URL:
http://pubsubhubbub.appspot.com/ hub
-Setup the feed for the CGI program:
+Setup the feed structure for the CGI program and also subscribe to the hub using the -s option.
cd /var/www/pubsub-data
pubsub_setup -s 'slashdot' 'http://pubsubhubbub.appspot.com/' 'http://rss.slashdot.org/Slashdot/slashdot'
+Unsubscribe from a hub:
+
+ cd /var/www/pubsub-data
+ pubsub_setup -u 'slashdot' 'http://pubsubhubbub.appspot.com/' 'http://rss.slashdot.org/Slashdot/slashdot'
+
+
Monitor script example
----------------------
-This monitors the log file using tail(1) and uses sfeed and sfeed_plain to write the line to stdout.
-This can then be piped to the suckless ii(1) program for IRC notifications for example.
-It uses sfeed for parsing RSS and Atom content and formats it to a plain-text list.
+This monitors the log file using tail(1) -f for new messages. It uses sfeed
+and sfeed_plain to process the new message (assuming it's RSS/Atom) and formats
+it to a plain-text list.
#!/bin/sh
cd /var/www/pubsub-data
@@ -130,6 +138,11 @@ It uses sfeed for parsing RSS and Atom content and formats it to a plain-text li
sfeed_plain
+This can then be piped to the suckless ii(1) program for IRC notifications.
+Of course the sfeed_plain program can be replaced by sfeed_mbox and a MTA for
+mail notifications too.
+
+
References
----------