From 8a878ba702e6e0d2fdc2b803c1ef2c66fd9acd99 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 8 Sep 2010 17:18:35 -0400 Subject: [PATCH] RSS feed generator --- webcit/Makefile.in | 4 +- webcit/feed_generator.c | 89 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 webcit/feed_generator.c diff --git a/webcit/Makefile.in b/webcit/Makefile.in index 8b1f25017..9189c9096 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -57,7 +57,7 @@ webcit: webserver.o context_loop.o ical_dezonify.o \ groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \ downloads.o addressbook_popup.o pushemail.o sysdep.o openid.o \ decode.o modules_init.o paramhandling.o utils.o \ - ical_maps.o ical_subst.o static.o \ + ical_maps.o ical_subst.o static.o feed_generator.o \ $(LIBOBJS) $(CC) $(LDFLAGS) -o webcit $(LIBOBJS) \ webserver.o context_loop.o cookie_conversion.o marchlist.o \ @@ -72,7 +72,7 @@ webcit: webserver.o context_loop.o ical_dezonify.o \ groupdav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o \ groupdav_put.o http_datestring.o setup_wizard.o fmt_date.o modules_init.o \ gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o decode.o \ - paramhandling.o utils.o ical_maps.o ical_subst.o static.o \ + paramhandling.o utils.o ical_maps.o ical_subst.o static.o feed_generator.o \ $(LIBS) .c.o: diff --git a/webcit/feed_generator.c b/webcit/feed_generator.c new file mode 100644 index 000000000..107856dc5 --- /dev/null +++ b/webcit/feed_generator.c @@ -0,0 +1,89 @@ +/* + * RSS/Atom feed generator + * + * Copyright (c) 2005-2010 by the citadel.org team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "webcit.h" +#include "webserver.h" + + + +/* + * Main entry point for GroupDAV requests + */ +void feed_rss(void) { + + output_headers(0, 0, 0, 1, 1, 0); + hprintf("Content-type: text/xml\r\n"); + hprintf( + "Server: %s / %s\r\n" + "Connection: close\r\n" + , + PACKAGE_STRING, ChrPtr(WC->serv_info->serv_software) + ); + begin_burst(); + + wc_printf("" + "" + "" + ); + + wc_printf(""); + escputs(ChrPtr(WC->CurRoom.name)); + wc_printf(""); + + wc_printf(""); + urlescputs(ChrPtr(site_prefix)); + wc_printf(""); + + // en-us + // Linux Today News Service + // + + // + // Linux Today + // http://linuxtoday.com/pics/ltnet.png + // http://linuxtoday.com + // + +#if 0 + + lorem ipsum dolor sit amet + Wed, 08 Sep 2010 20:03:21 GMT + http://xxxxx.xxxx.xxxxxx.xxxx.xxx + <b>foo bar baz:</b> lorem ipsum dolor sit amet, foo bar eek + xxxx-xxxx-xxxx-xxxx-xxxx-xxxx + +#endif + + wc_printf("" + "" + "\r\n\r\n" + ); + + wDumpContent(0); + end_webcit_session(); +} + + +void +InitModule_RSS +(void) +{ + WebcitAddUrlHandler(HKEY("feed_rss"), "", 0, feed_rss, ANONYMOUS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE); +} -- 2.30.2