summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2021-12-23 18:30:19 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2021-12-23 18:30:19 +0100
commit00dda4a201683c215299f8327fc0dc2765786ba5 (patch)
tree7c23213aafa35a1cf9b74fc2dcdfe63cd08ba2d8 /README
parent4e282a7dcba5960f6f59f283ef1ebed6c02f5983 (diff)
README: improve newsboat export script
Performance improvements, use feed URL if the feed title is not (yet) set.
Diffstat (limited to 'README')
-rw-r--r--README16
1 files changed, 9 insertions, 7 deletions
diff --git a/README b/README
index 246953d..fea2da8 100644
--- a/README
+++ b/README
@@ -745,9 +745,7 @@ TSV format.
#
# Dependencies: sqlite3, awk.
#
- # Usage: create some directory to store the feeds, run this script.
- #
- # Assumes feednames are unique and a feed title is set.
+ # Usage: create some directory to store the feeds then run this script.
# newsboat cache.db file.
cachefile="$HOME/.newsboat/cache.db"
@@ -772,7 +770,7 @@ TSV format.
.quit
!EOF
# convert to sfeed(5) TSV format.
- awk '
+ LC_ALL=C awk '
BEGIN {
FS = "\x1f";
RS = "\x1e";
@@ -795,9 +793,13 @@ TSV format.
gsub("\t", "\\t", s);
return s;
}
- function feedname(url, title) {
- gsub("/", "_", title);
- return title;
+ function feedname(feedurl, feedtitle) {
+ if (feedtitle == "") {
+ gsub("/", "_", feedurl);
+ return feedurl;
+ }
+ gsub("/", "_", feedtitle);
+ return feedtitle;
}
{
fname = feedname($9, $10);