summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Krennmair <ak@synflood.at>2007-02-12 15:32:04 +0000
committerAndreas Krennmair <ak@synflood.at>2007-02-12 15:32:04 +0000
commit552092a120bff2641429d77beffff19c8e7b1180 (patch)
treea7e49f198d681614955ef57001ecbeaa7fc6677a
parent8df7317196cd45f71cbac21734ac21c2b7381529 (diff)
Andreas Krennmair:
inreased version number to 0.2 (first preparations for next release) more logging, RSS 2.0 and Atom support improved a bit
-rw-r--r--config.h2
-rw-r--r--src/rss.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/config.h b/config.h
index 5b66e605..1a3c381b 100644
--- a/config.h
+++ b/config.h
@@ -2,7 +2,7 @@
#define NEWSBEUTER_CONFIG__H
#define PROGRAM_NAME "newsbeuter"
-#define PROGRAM_VERSION "0.1.1"
+#define PROGRAM_VERSION "0.2"
#define PROGRAM_URL "http://synflood.at/newsbeuter.html"
#define USER_AGENT PROGRAM_NAME " rss feedreader " PROGRAM_VERSION " (" PROGRAM_URL ")"
diff --git a/src/rss.cpp b/src/rss.cpp
index 97ad68b7..0d10e947 100644
--- a/src/rss.cpp
+++ b/src/rss.cpp
@@ -81,7 +81,7 @@ rss_feed rss_parser::parse() {
mrss_tag_t * content;
- if (mrss_search_tag(item, "encoded", "http://purl.org/rss/1.0/modules/content/", &content) == MRSS_OK && content) {
+ if (mrss->version == MRSS_VERSION_2_0 && mrss_search_tag(item, "encoded", "http://purl.org/rss/1.0/modules/content/", &content) == MRSS_OK && content) {
/* RSS 2.0 content:encoded */
GetLogger().log(LOG_DEBUG, "rss_parser::parse: found rss 2.0 content:encoded: %s\n", content->value);
if (content->value) {
@@ -91,8 +91,11 @@ rss_feed rss_parser::parse() {
free(str);
}
}
+ } else {
+ GetLogger().log(LOG_DEBUG, "rss_parser::parse: found no rss 2.0 content:encoded");
}
- if (x.description().length() == 0 && mrss_search_tag(mrss, "content", NULL, &content) == MRSS_OK && content) {
+
+ if ((mrss->version == MRSS_VERSION_ATOM_0_3 || mrss->version == MRSS_VERSION_ATOM_1_0) && mrss_search_tag(mrss, "content", NULL, &content) == MRSS_OK && content) {
/* Atom content */
GetLogger().log(LOG_DEBUG, "rss_parser::parse: found atom content: %s\n", content->value);
if (content->value) {
@@ -102,7 +105,10 @@ rss_feed rss_parser::parse() {
free(str);
}
}
+ } else {
+ GetLogger().log(LOG_DEBUG, "rss_parser::parse: found no atom content");
}
+
if (x.description().length() == 0 && item->description) {
char * str = stringprep_convert(item->description,stringprep_locale_charset(), encoding);
if (str) {
@@ -110,6 +116,7 @@ rss_feed rss_parser::parse() {
free(str);
}
}
+
if (item->pubDate)
x.set_pubDate(parse_date(item->pubDate));
else