[hobbit] RSS link

Henrik Stoerner henrik at hswn.dk
Tue Mar 22 10:20:27 CET 2005


On Sat, Mar 12, 2005 at 02:47:03AM -0500, Asif Iqbal wrote:
> On Fri, Feb 25, 2005 at 04:15:32PM, Asif Iqbal wrote:
> > Hi All
> > 
> > I added the --rss --rsslimit=yellow to bbgen and now it created a bb.rss
> > file under my www dir. But the content of the file is
> >   <link>https://hobbit.qwest.net/hobbit</link>
> > Is there a way I can change the link to https://hobbit.qwest.net/hobbit/
> > so everytime it updates it stays the same way?
> 
> Anyone has any suggestion on this? It is not high priority. 

Patch attached, against RC6.

Henrik
-------------- next part --------------
--- bbdisplay/rssgen.c	2005/01/20 10:45:44	1.13
+++ bbdisplay/rssgen.c	2005/03/22 09:03:55
@@ -1,17 +1,17 @@
 /*----------------------------------------------------------------------------*/
-/* Big Brother webpage generator tool.                                        */
+/* Hobbit webpage generator tool.                                             */
 /*                                                                            */
 /* This file contains code to generate RSS/RDF format output of alerts.       */
 /* It is heavily influenced by Jeff Stoner's bb_content-feed script.          */
 /*                                                                            */
-/* Copyright (C) 2003 Henrik Storner <henrik at storner.dk>                      */
+/* Copyright (C) 2003-2005 Henrik Storner <henrik at storner.dk>                 */
 /*                                                                            */
 /* This program is released under the GNU General Public License (GPL),       */
 /* version 2. See the file "COPYING" for details.                             */
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: rssgen.c,v 1.13 2005/01/20 10:45:44 henrik Exp $";
+static char rcsid[] = "$Id: rssgen.c,v 1.14 2005/03/22 08:32:15 henrik Exp $";
 
 #include <limits.h>
 #include <stdio.h>
@@ -25,7 +25,11 @@
 char *rssversion = "0.91";
 int  rsscolorlimit = COL_RED;
 int  nssidebarcolorlimit = COL_RED;
+#ifdef HOBBIT
+char *rsstitle = "Hobbit Critical Alerts";
+#else
 char *rsstitle = "Big Brother Critical Alerts";
+#endif
 
 #define RSS091 0
 #define RSS092 1
@@ -69,7 +73,7 @@
 		fprintf(fd, "<rss version=\"0.91\">\n");
 		fprintf(fd, "<channel>\n");
 		fprintf(fd, "  <title>%s</title>\n", rsstitle);
-		fprintf(fd, "  <link>%s</link>\n", xgetenv("BBWEBHOSTURL"));
+		fprintf(fd, "  <link>%s/</link>\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "  <description>Last updated on %s</description>\n", timestamp);
 		break;
 	  case RSS092:
@@ -77,12 +81,12 @@
 		fprintf(fd, "<rss version=\"0.92\">\n");
 		fprintf(fd, "<channel>\n");
 		fprintf(fd, "  <title>%s</title>\n", rsstitle);
-		fprintf(fd, "  <link>%s</link>\n", xgetenv("BBWEBHOSTURL"));
+		fprintf(fd, "  <link>%s/</link>\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "  <description>Last updated on %s</description>\n", timestamp);
 		fprintf(fd, "  <image>\n");
 		fprintf(fd, "    <url>%s/gifs/bblogo.gif</url>\n", xgetenv("BBWEBHOSTURL"));
-		fprintf(fd, "    <title>Big Brother</title>\n");
-		fprintf(fd, "    <link>http://bb4.com</link>\n");
+		fprintf(fd, "    <title>Hobbit</title>\n");
+		fprintf(fd, "    <link>http://hobbitmon.sourceforge.net/</link>\n");
 		fprintf(fd, "  </image>\n");
 		break;
 	  case RSS10:
@@ -90,7 +94,7 @@
 		fprintf(fd, "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns=\"http://purl.org/rss/1.0/\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n");
 		fprintf(fd, "  <channel rdf:about=\"%s\">\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "    <title>%s</title>\n", rsstitle);
-		fprintf(fd, "    <link>%s</link>\n", xgetenv("BBWEBHOSTURL"));
+		fprintf(fd, "    <link>%s/</link>\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "    <description>Last updated on %s</description>\n", timestamp);
 		fprintf(fd, "  </channel>\n");
 		break;
@@ -99,7 +103,7 @@
 		fprintf(fd, "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n");
 		fprintf(fd, "  <channel>\n");
 		fprintf(fd, "    <title>%s</title>\n", rsstitle);
-		fprintf(fd, "    <link>%s</link>\n", xgetenv("BBWEBHOSTURL"));
+		fprintf(fd, "    <link>%s/</link>\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "    <description>Last updated on %s</description>\n", timestamp);
 		fprintf(fd, "    <ttl>%d</ttl>\n", ttlvalue);
 		break;
@@ -163,7 +167,7 @@
 	if (!anyshown) {
 		fprintf(fd, "  <item>\n");
 		fprintf(fd, "    <title>No Critical Alerts</title>\n");
-		fprintf(fd, "    <link>%s</link>\n", xgetenv("BBWEBHOSTURL"));
+		fprintf(fd, "    <link>%s/</link>\n", xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "  </item>\n");
 	}
 
@@ -215,7 +219,7 @@
 	fprintf(fd, "<HTML>\n");
 	fprintf(fd, "  <HEAD>\n");
 	fprintf(fd, "    <TITLE>%s</TITLE>\n", rsstitle);
-	fprintf(fd, "    <META NAME=\"Generator\" CONTENT=\"bbgen - generator for Big Brother\">\n");
+	fprintf(fd, "    <META NAME=\"Generator\" CONTENT=\"bbgen - generator for Hobbit\">\n");
 	fprintf(fd, "    <META HTTP-EQUIV=\"Refresh\" CONTENT=\"%d; URL=%s/%s\">\n",
 		ttlvalue, xgetenv("BBWEBHOSTURL"), nssidebarfilename);
 	fprintf(fd, "  </HEAD>\n");
@@ -259,7 +263,7 @@
 
 	if (!anyshown) {
 		fprintf(fd, "      <LI>\n");
-		fprintf(fd, "        <A TARGET=\"_content\" HREF=\"%s\">No Critical Alerts</A>\n",
+		fprintf(fd, "        <A TARGET=\"_content\" HREF=\"%s/\">No Critical Alerts</A>\n",
 			xgetenv("BBWEBHOSTURL"));
 		fprintf(fd, "      </LI>\n");
 	}


More information about the Xymon mailing list