2 * Bring external RSS feeds into rooms.
4 * Copyright (c) 2007-2010 by the citadel.org team
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #if TIME_WITH_SYS_TIME
26 # include <sys/time.h>
30 # include <sys/time.h>
39 #include <sys/types.h>
42 #include <curl/curl.h>
43 #include <libcitadel.h>
46 #include "citserver.h"
50 #include "ctdl_module.h"
51 #include "clientsocket.h"
53 #include "parsedate.h"
55 #include "citadel_dirs.h"
58 #include "event_client.h"
59 #include "rss_atom_parser.h"
61 HashList *StartHandlers = NULL;
62 HashList *EndHandlers = NULL;
63 HashList *KnownNameSpaces = NULL;
64 void AddRSSStartHandler(rss_handler_func Handler, int Flags, const char *key, long len)
67 h = (rss_xml_handler*) malloc(sizeof (rss_xml_handler));
70 Put(StartHandlers, key, len, h, NULL);
72 void AddRSSEndHandler(rss_handler_func Handler, int Flags, const char *key, long len)
75 h = (rss_xml_handler*) malloc(sizeof (rss_xml_handler));
78 Put(EndHandlers, key, len, h, NULL);
84 * Convert an RDF/RSS datestamp into a time_t
86 time_t rdf_parsedate(const char *p)
92 if (strlen(p) < 10) return 0L;
94 memset(&tm, 0, sizeof tm);
97 * If the timestamp appears to be in W3C datetime format, try to
98 * parse it. See also: http://www.w3.org/TR/NOTE-datetime
100 * This code, along with parsedate.c, is a potential candidate for
101 * moving into libcitadel.
103 if ( (p[4] == '-') && (p[7] == '-') ) {
104 tm.tm_year = atoi(&p[0]) - 1900;
105 tm.tm_mon = atoi(&p[5]) - 1;
106 tm.tm_mday = atoi(&p[8]);
107 if ( (p[10] == 'T') && (p[13] == ':') ) {
108 tm.tm_hour = atoi(&p[11]);
109 tm.tm_min = atoi(&p[14]);
114 /* hmm... try RFC822 date stamp format */
117 if (t > 0) return(t);
119 /* yeesh. ok, just return the current date and time. */
123 void flush_rss_item(rss_item *ri)
125 /* Initialize the feed item data structure */
126 FreeStrBuf(&ri->guid);
127 FreeStrBuf(&ri->title);
128 FreeStrBuf(&ri->link);
129 FreeStrBuf(&ri->author_or_creator);
130 FreeStrBuf(&ri->author_email);
131 FreeStrBuf(&ri->author_url);
132 FreeStrBuf(&ri->description);
135 void rss_xml_start(void *data, const char *supplied_el, const char **attr)
138 rsscollection *rssc = (rsscollection*) data;
139 rssnetcfg *Cfg = rssc->Cfg;
140 rss_item *ri = rssc->Item;
145 /* Axe the namespace, we don't care about it */
146 /// CtdlLogPrintf(0, "RSS: supplied el %d: %s...\n", rssc->Cfg->ItemType, supplied_el);
148 while (sep = strchr(pel, ':'), sep) {
152 if (pel != supplied_el)
156 if (!GetHash(KnownNameSpaces,
158 pel - supplied_el - 1,
162 CtdlLogPrintf(0, "RSS: START ignoring because of wrong namespace [%s] = [%s]\n",
169 StrBufPlain(rssc->Key, pel, -1);
170 StrBufLowerCase(rssc->Key);
171 if (GetHash(StartHandlers, SKEY(rssc->Key), &pv))
173 rssc->Current = h = (rss_xml_handler*) pv;
175 if (((h->Flags & RSS_UNSET) != 0) &&
176 (Cfg->ItemType == RSS_UNSET))
178 h->Handler(rssc->CData, ri, Cfg, attr);
180 else if (((h->Flags & RSS_RSS) != 0) &&
181 (Cfg->ItemType == RSS_RSS))
183 h->Handler(rssc->CData, ri, Cfg, attr);
185 else if (((h->Flags & RSS_ATOM) != 0) &&
186 (Cfg->ItemType == RSS_ATOM))
188 h->Handler(rssc->CData, ri, Cfg, attr);
192 CtdlLogPrintf(0, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
197 CtdlLogPrintf(0, "RSS: START unhandled: [%s] [%s]...\n", pel, supplied_el);
201 void rss_xml_end(void *data, const char *supplied_el)
204 rsscollection *rssc = (rsscollection*) data;
205 rssnetcfg *Cfg = rssc->Cfg;
206 rss_item *ri = rssc->Item;
211 /* Axe the namespace, we don't care about it */
213 while (sep = strchr(pel, ':'), sep) {
216 // CtdlLogPrintf(0, "RSS: END %s...\n", el);
217 if (pel != supplied_el)
221 if (!GetHash(KnownNameSpaces,
223 pel - supplied_el - 1,
227 CtdlLogPrintf(0, "RSS: END ignoring because of wrong namespace [%s] = [%s]\n",
228 supplied_el, ChrPtr(rssc->CData));
230 FlushStrBuf(rssc->CData);
235 StrBufPlain(rssc->Key, pel, -1);
236 StrBufLowerCase(rssc->Key);
237 if (GetHash(EndHandlers, SKEY(rssc->Key), &pv))
239 h = (rss_xml_handler*) pv;
241 if (((h->Flags & RSS_UNSET) != 0) &&
242 (Cfg->ItemType == RSS_UNSET))
244 h->Handler(rssc->CData, ri, Cfg, NULL);
246 else if (((h->Flags & RSS_RSS) != 0) &&
247 (Cfg->ItemType == RSS_RSS))
249 h->Handler(rssc->CData, ri, Cfg, NULL);
251 else if (((h->Flags & RSS_ATOM) != 0) &&
252 (Cfg->ItemType == RSS_ATOM))
254 h->Handler(rssc->CData, ri, Cfg, NULL);
258 CtdlLogPrintf(0, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
263 CtdlLogPrintf(0, "RSS: END unhandled: [%s] [%s] = [%s]...\n", pel, supplied_el, ChrPtr(rssc->CData));
265 FlushStrBuf(rssc->CData);
266 rssc->Current = NULL;
273 void RSS_item_rss_start (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
275 CtdlLogPrintf(CTDL_DEBUG, "RSS: This is an RSS feed.\n");
276 Cfg->ItemType = RSS_RSS;
279 void RSS_item_rdf_start(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
281 CtdlLogPrintf(CTDL_DEBUG, "RSS: This is an RDF feed.\n");
282 Cfg->ItemType = RSS_RSS;
285 void ATOM_item_feed_start(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
287 CtdlLogPrintf(CTDL_DEBUG, "RSS: This is an ATOM feed.\n");
288 Cfg->ItemType = RSS_ATOM;
292 void RSS_item_item_start(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
294 ri->item_tag_nesting ++;
298 void ATOM_item_entry_start(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
301 ri->item_tag_nesting ++;
305 void ATOM_item_link_start (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
308 const char *pHref = NULL;
309 const char *pType = NULL;
310 const char *pRel = NULL;
311 const char *pTitle = NULL;
313 for (i = 0; Attr[i] != NULL; i+=2)
315 if (!strcmp(Attr[i], "href"))
319 else if (!strcmp(Attr[i], "rel"))
323 else if (!strcmp(Attr[i], "type"))
327 else if (!strcmp(Attr[i], "title"))
333 return; /* WHUT? Pointing... where? */
334 if ((pType != NULL) && !strcasecmp(pType, "application/atom+xml"))
335 return; /* these just point to other rss resources, we're not interested in them. */
338 if (!strcasecmp (pRel, "replies"))
340 NewStrBufDupAppendFlush(&ri->reLink, NULL, pHref, -1);
341 StrBufTrim(ri->link);
342 NewStrBufDupAppendFlush(&ri->reLinkTitle, NULL, pTitle, -1);
344 else if (!strcasecmp(pRel, "alternate")) /* Alternative representation of this Item... */
346 NewStrBufDupAppendFlush(&ri->link, NULL, pHref, -1);
347 StrBufTrim(ri->link);
348 NewStrBufDupAppendFlush(&ri->linkTitle, NULL, pTitle, -1);
351 #if 0 /* these are also defined, but dunno what to do with them.. */
352 else if (!strcasecmp(pRel, "related"))
355 else if (!strcasecmp(pRel, "self"))
358 else if (!strcasecmp(pRel, "enclosure"))
359 {/* this reference can get big, and is probably the full article... */
361 else if (!strcasecmp(pRel, "via"))
362 {/* this article was provided via... */
366 else if (StrLength(ri->link) == 0)
368 NewStrBufDupAppendFlush(&ri->link, NULL, pHref, -1);
369 StrBufTrim(ri->link);
370 NewStrBufDupAppendFlush(&ri->linkTitle, NULL, pTitle, -1);
377 void ATOMRSS_item_title_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
379 if ((ri->item_tag_nesting == 0) && (StrLength(CData) > 0)) {
380 NewStrBufDupAppendFlush(&ri->channel_title, CData, NULL, 0);
381 StrBufTrim(ri->channel_title);
385 void RSS_item_guid_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
387 if (StrLength(CData) > 0) {
388 NewStrBufDupAppendFlush(&ri->guid, CData, NULL, 0);
392 void ATOM_item_id_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
394 if (StrLength(CData) > 0) {
395 NewStrBufDupAppendFlush(&ri->guid, CData, NULL, 0);
400 void RSS_item_link_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
402 if (StrLength(CData) > 0) {
403 NewStrBufDupAppendFlush(&ri->link, CData, NULL, 0);
404 StrBufTrim(ri->link);
407 void RSS_item_relink_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
409 if (StrLength(CData) > 0) {
410 NewStrBufDupAppendFlush(&ri->reLink, CData, NULL, 0);
411 StrBufTrim(ri->reLink);
415 void RSSATOM_item_title_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
417 if (StrLength(CData) > 0) {
418 NewStrBufDupAppendFlush(&ri->title, CData, NULL, 0);
419 StrBufTrim(ri->title);
423 void ATOM_item_content_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
425 long olen = StrLength (ri->description);
426 long clen = StrLength (CData);
430 NewStrBufDupAppendFlush(&ri->description, CData, NULL, 0);
431 StrBufTrim(ri->description);
433 else if (olen < clen) {
434 FlushStrBuf(ri->description);
435 NewStrBufDupAppendFlush(&ri->description, CData, NULL, 0);
436 StrBufTrim(ri->description);
440 void ATOM_item_summary_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
442 /* this can contain an abstract of the article. but we don't want to verwrite a full document if we already have it. */
443 if ((StrLength(CData) > 0) && (StrLength(ri->description) == 0))
445 NewStrBufDupAppendFlush(&ri->description, CData, NULL, 0);
446 StrBufTrim(ri->description);
450 void RSS_item_description_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
452 long olen = StrLength (ri->description);
453 long clen = StrLength (CData);
457 NewStrBufDupAppendFlush(&ri->description, CData, NULL, 0);
458 StrBufTrim(ri->description);
460 else if (olen < clen) {
461 FlushStrBuf(ri->description);
462 NewStrBufDupAppendFlush(&ri->description, CData, NULL, 0);
463 StrBufTrim(ri->description);
468 void ATOM_item_published_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
470 if (StrLength(CData) > 0) {
472 ri->pubdate = rdf_parsedate(ChrPtr(CData));
476 void ATOM_item_updated_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
478 if (StrLength(CData) > 0) {
480 ri->pubdate = rdf_parsedate(ChrPtr(CData));
484 void RSS_item_pubdate_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
486 if (StrLength(CData) > 0) {
488 ri->pubdate = rdf_parsedate(ChrPtr(CData));
493 void RSS_item_date_end (StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
495 if (StrLength(CData) > 0) {
497 ri->pubdate = rdf_parsedate(ChrPtr(CData));
503 void RSS_item_author_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
505 if (StrLength(CData) > 0) {
506 NewStrBufDupAppendFlush(&ri->author_or_creator, CData, NULL, 0);
507 StrBufTrim(ri->author_or_creator);
512 void ATOM_item_name_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
514 if (StrLength(CData) > 0) {
515 NewStrBufDupAppendFlush(&ri->author_or_creator, CData, NULL, 0);
516 StrBufTrim(ri->author_or_creator);
520 void ATOM_item_email_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
522 if (StrLength(CData) > 0) {
523 NewStrBufDupAppendFlush(&ri->author_email, CData, NULL, 0);
524 StrBufTrim(ri->author_email);
528 void RSS_item_creator_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
530 if ((StrLength(CData) > 0) &&
531 (StrLength(ri->author_or_creator) == 0))
533 NewStrBufDupAppendFlush(&ri->author_or_creator, CData, NULL, 0);
534 StrBufTrim(ri->author_or_creator);
539 void ATOM_item_uri_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
541 if (StrLength(CData) > 0) {
542 NewStrBufDupAppendFlush(&ri->author_url, CData, NULL, 0);
543 StrBufTrim(ri->author_url);
547 void RSS_item_item_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
549 --ri->item_tag_nesting;
554 void ATOM_item_entry_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
556 --ri->item_tag_nesting;
560 void RSS_item_rss_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
562 // CtdlLogPrintf(CTDL_DEBUG, "End of feed detected. Closing parser.\n");
563 ri->done_parsing = 1;
566 void RSS_item_rdf_end(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
568 // CtdlLogPrintf(CTDL_DEBUG, "End of feed detected. Closing parser.\n");
569 ri->done_parsing = 1;
573 void RSSATOM_item_ignore(StrBuf *CData, rss_item *ri, rssnetcfg *Cfg, const char** Attr)
580 * This callback stores up the data which appears in between tags.
582 void rss_xml_cdata_start(void *data)
584 rsscollection *rssc = (rsscollection*) data;
586 FlushStrBuf(rssc->CData);
589 void rss_xml_cdata_end(void *data)
592 void rss_xml_chardata(void *data, const XML_Char *s, int len)
594 rsscollection *rssc = (rsscollection*) data;
596 StrBufAppendBufPlain (rssc->CData, s, len, 0);
600 * Callback function for passing libcurl's output to expat for parsing
602 size_t rss_libcurl_callback(void *ptr, size_t size, size_t nmemb, void *stream)
604 XML_Parse((XML_Parser)stream, ptr, (size * nmemb), 0);
610 eNextState ParseRSSReply(AsyncIO *IO)
620 ri->roomlist_parts = rssc->Cfg->roomlist_parts;
621 ri->roomlist = rssc->Cfg->rooms;
622 rssc->CData = NewStrBufPlain(NULL, SIZ);
623 rssc->Key = NewStrBuf();
625 StrBufSipLine(rssc->Key, IO->HttpReq.ReplyData, &at);
628 #define encoding "encoding=\""
629 ptr = strstr(ChrPtr(rssc->Key), encoding);
634 ptr += sizeof (encoding) - 1;
635 pche = strchr(ptr, '"');
637 StrBufCutAt(rssc->Key, -1, pche);
644 CtdlLogPrintf(CTDL_ALERT, "RSS: Now parsing [%s] \n", ChrPtr(rssc->Cfg->Url));
646 rssc->xp = XML_ParserCreateNS(ptr, ':');
648 CtdlLogPrintf(CTDL_ALERT, "Cannot create XML parser!\n");
651 FlushStrBuf(rssc->Key);
653 XML_SetElementHandler(rssc->xp, rss_xml_start, rss_xml_end);
654 XML_SetCharacterDataHandler(rssc->xp, rss_xml_chardata);
655 XML_SetUserData(rssc->xp, rssc);
656 XML_SetCdataSectionHandler(rssc->xp,
661 len = StrLength(IO->HttpReq.ReplyData);
662 ptr = SmashStrBuf(&IO->HttpReq.ReplyData);
663 XML_Parse(rssc->xp, ptr, len, 0);
665 if (ri->done_parsing == 0)
666 XML_Parse(rssc->xp, "", 0, 1);
669 CtdlLogPrintf(CTDL_ALERT, "RSS: XML Status [%s] \n",
671 XML_GetErrorCode(rssc->xp)));
674 XML_ParserFree(rssc->xp);
677 FreeStrBuf(&rssc->CData);
678 FreeStrBuf(&rssc->Key);
680 ///Cfg->next_poll = time(NULL) + config.c_net_freq;
682 return eTerminateConnection;
686 void rss_cleanup(void)
688 DeleteHash(&StartHandlers);
689 DeleteHash(&EndHandlers);
690 DeleteHash(&KnownNameSpaces);
694 CTDL_MODULE_INIT(rssparser)
698 StartHandlers = NewHash(1, NULL);
699 EndHandlers = NewHash(1, NULL);
701 AddRSSStartHandler(RSS_item_rss_start, RSS_UNSET, HKEY("rss"));
702 AddRSSStartHandler(RSS_item_rdf_start, RSS_UNSET, HKEY("rdf"));
703 AddRSSStartHandler(ATOM_item_feed_start, RSS_UNSET, HKEY("feed"));
704 AddRSSStartHandler(RSS_item_item_start, RSS_RSS, HKEY("item"));
705 AddRSSStartHandler(ATOM_item_entry_start, RSS_ATOM, HKEY("entry"));
706 AddRSSStartHandler(ATOM_item_link_start, RSS_ATOM, HKEY("link"));
708 AddRSSEndHandler(ATOMRSS_item_title_end, RSS_ATOM|RSS_RSS|RSS_REQUIRE_BUF, HKEY("title"));
709 AddRSSEndHandler(RSS_item_guid_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("guid"));
710 AddRSSEndHandler(ATOM_item_id_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("id"));
711 AddRSSEndHandler(RSS_item_link_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("link"));
713 // hm, rss to the comments of that blog, might be interesting in future, but...
714 AddRSSEndHandler(RSS_item_relink_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("commentrss"));
716 AddRSSEndHandler(RSS_item_relink_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("comments"));
718 AddRSSEndHandler(RSSATOM_item_title_end, RSS_ATOM|RSS_RSS|RSS_REQUIRE_BUF, HKEY("title"));
719 AddRSSEndHandler(ATOM_item_content_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("content"));
720 AddRSSEndHandler(RSS_item_description_end, RSS_RSS|RSS_ATOM|RSS_REQUIRE_BUF, HKEY("encoded"));
721 AddRSSEndHandler(ATOM_item_summary_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("summary"));
722 AddRSSEndHandler(RSS_item_description_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("description"));
723 AddRSSEndHandler(ATOM_item_published_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("published"));
724 AddRSSEndHandler(ATOM_item_updated_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("updated"));
725 AddRSSEndHandler(RSS_item_pubdate_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("pubdate"));
726 AddRSSEndHandler(RSS_item_date_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("date"));
727 AddRSSEndHandler(RSS_item_author_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("author"));
728 AddRSSEndHandler(RSS_item_creator_end, RSS_RSS|RSS_REQUIRE_BUF, HKEY("creator"));
730 AddRSSEndHandler(ATOM_item_email_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("email"));
731 AddRSSEndHandler(ATOM_item_name_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("name"));
732 AddRSSEndHandler(ATOM_item_uri_end, RSS_ATOM|RSS_REQUIRE_BUF, HKEY("uri"));
734 AddRSSEndHandler(RSS_item_item_end, RSS_RSS, HKEY("item"));
735 AddRSSEndHandler(RSS_item_rss_end, RSS_RSS, HKEY("rss"));
736 AddRSSEndHandler(RSS_item_rdf_end, RSS_RSS, HKEY("rdf"));
737 AddRSSEndHandler(ATOM_item_entry_end, RSS_ATOM, HKEY("entry"));
740 /* at the start of atoms: <seq> <li>link to resource</li></seq> ignore them. */
741 AddRSSStartHandler(RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("seq"));
742 AddRSSEndHandler (RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("seq"));
743 AddRSSStartHandler(RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("li"));
744 AddRSSEndHandler (RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("li"));
746 /* links to other feed generators... */
747 AddRSSStartHandler(RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("feedflare"));
748 AddRSSEndHandler (RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("feedflare"));
749 AddRSSStartHandler(RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("browserfriendly"));
750 AddRSSEndHandler (RSSATOM_item_ignore, RSS_RSS|RSS_ATOM, HKEY("browserfriendly"));
752 KnownNameSpaces = NewHash(1, NULL);
753 Put(KnownNameSpaces, HKEY("http://a9.com/-/spec/opensearch/1.1/"), NULL, reference_free_handler);
754 Put(KnownNameSpaces, HKEY("http://a9.com/-/spec/opensearchrss/1.0/"), NULL, reference_free_handler);
755 Put(KnownNameSpaces, HKEY("http://backend.userland.com/creativeCommonsRssModule"), NULL, reference_free_handler);
756 Put(KnownNameSpaces, HKEY("http://purl.org/atom/ns#"), NULL, reference_free_handler);
757 Put(KnownNameSpaces, HKEY("http://purl.org/dc/elements/1.1/"), NULL, reference_free_handler);
758 Put(KnownNameSpaces, HKEY("http://purl.org/rss/1.0/"), NULL, reference_free_handler);
759 Put(KnownNameSpaces, HKEY("http://purl.org/rss/1.0/modules/content/"), NULL, reference_free_handler);
760 Put(KnownNameSpaces, HKEY("http://purl.org/rss/1.0/modules/slash/"), NULL, reference_free_handler);
761 Put(KnownNameSpaces, HKEY("http://purl.org/rss/1.0/modules/syndication/"), NULL, reference_free_handler);
762 Put(KnownNameSpaces, HKEY("http://purl.org/rss/1.0/"), NULL, reference_free_handler);
763 Put(KnownNameSpaces, HKEY("http://purl.org/syndication/thread/1.0"), NULL, reference_free_handler);
764 Put(KnownNameSpaces, HKEY("http://rssnamespace.org/feedburner/ext/1.0"), NULL, reference_free_handler);
765 Put(KnownNameSpaces, HKEY("http://schemas.google.com/g/2005"), NULL, reference_free_handler);
766 Put(KnownNameSpaces, HKEY("http://webns.net/mvcb/"), NULL, reference_free_handler);
767 Put(KnownNameSpaces, HKEY("http://web.resource.org/cc/"), NULL, reference_free_handler);
768 Put(KnownNameSpaces, HKEY("http://wellformedweb.org/CommentAPI/"), NULL, reference_free_handler);
769 Put(KnownNameSpaces, HKEY("http://www.georss.org/georss"), NULL, reference_free_handler);
770 Put(KnownNameSpaces, HKEY("http://www.w3.org/1999/xhtml"), NULL, reference_free_handler);
771 Put(KnownNameSpaces, HKEY("http://www.w3.org/1999/02/22-rdf-syntax-ns#"), NULL, reference_free_handler);
772 Put(KnownNameSpaces, HKEY("http://www.w3.org/1999/02/22-rdf-syntax-ns#"), NULL, reference_free_handler);
773 Put(KnownNameSpaces, HKEY("http://www.w3.org/2003/01/geo/wgs84_pos#"), NULL, reference_free_handler);
774 Put(KnownNameSpaces, HKEY("http://www.w3.org/2005/Atom"), NULL, reference_free_handler);
775 Put(KnownNameSpaces, HKEY("urn:flickr:"), NULL, reference_free_handler);
777 /* we don't like these namespaces because of they shadow our usefull parameters. */
778 Put(KnownNameSpaces, HKEY("http://search.yahoo.com/mrss/"), NULL, reference_free_handler);
780 CtdlRegisterCleanupHook(rss_cleanup);