summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2012-08-03 14:59:22 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2012-08-03 14:59:22 +0200
commit50d0bc170c2b7c783e09d81d38a824422712b6e5 (patch)
tree992cc8881872888e649e2e4146455ec447290cfa
parent6df391bcd6dc4cd03349907400d98e6445211f66 (diff)
Rename sfeed_opml_config to sfeed_opml_import
Because I'm adding a sfeed_opml_export script. Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r--sfeed_opml_import.1 (renamed from sfeed_opml_config.1)4
-rw-r--r--sfeed_opml_import.c (renamed from sfeed_opml_config.c)6
2 files changed, 6 insertions, 4 deletions
diff --git a/sfeed_opml_config.1 b/sfeed_opml_import.1
index 523f99e..c5650ca 100644
--- a/sfeed_opml_config.1
+++ b/sfeed_opml_import.1
@@ -1,8 +1,8 @@
.TH SFEED 1 sfeed\-VERSION
.SH NAME
-sfeed_opml_config \- generate a sfeedrc config file based on an opml file
+sfeed_opml_import \- generate a sfeedrc config file based on an opml file
.SH SYNOPSIS
-.B sfeed_opml_config
+.B sfeed_opml_import
.SH DESCRIPTION
Reads the opml XML data from stdin and writes the config file text to stdout.
.SH SEE ALSO
diff --git a/sfeed_opml_config.c b/sfeed_opml_import.c
index 0d74820..f328fc1 100644
--- a/sfeed_opml_config.c
+++ b/sfeed_opml_import.c
@@ -23,15 +23,17 @@ getattrvalue(const char **atts, const char *name) {
void XMLCALL
xml_handler_start_element(void *data, const char *name, const char **atts) {
- char *feedurl = NULL, *feedname = NULL;;
+ char *feedurl = NULL, *feedname = NULL, *basesiteurl = NULL;
if(!strcasecmp(name, "outline")) {
if(!(feedname = getattrvalue(atts, "text")) &&
!(feedname = getattrvalue(atts, "title")))
feedname = "unnamed";
+ if(!(basesiteurl = getattrvalue(atts, "htmlurl")))
+ basesiteurl = "";
if(!(feedurl = getattrvalue(atts, "xmlurl")))
feedurl = "";
- printf("\tfeed \"%s\" \"%s\"\n", feedname, feedurl);
+ printf("\tfeed \"%s\" \"%s\" \"%s\"\n", feedname, feedurl, basesiteurl);
}
}