fusch.online

git / lists / casts

git.fusch.online/planner

Generate static pages from a list of links
git clone git://git.fusch.online/planner
Log / Files / Readme / Issues

commit d78a28518460971850e83ce044b5d86fe36bff43
parent 68731f2d255d71e9376c971bbad7cd50965b9365
Author: hbkk <tschugg@posteo.de>
Date:   Mon,  1 Apr 2019 02:13:18 +0200

read from stdin if no file is specified

Diffstat:
Mlinks.sh | 13++++++-------
Mtodo.txt | 4++--
2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/links.sh b/links.sh @@ -158,12 +158,12 @@ print_rss_head() { <channel> <title>planner</title> - <link>file:///home/hbkk/tmp/site/index.html</link> + <link>$PLANNER_URL</link> <description>planner auf der wippe</description> <language>en</language> <lastBuildDate>$builddate</lastBuildDate> <pubDate>$builddate</pubDate> - <atom:link href="file:///home/hbkk/tmp/site/rss" rel="self" type="application/rss+xml" /> + <atom:link href="$PLANNER_URL/rss" rel="self" type="application/rss+xml" /> EOF } @@ -194,7 +194,6 @@ EOF # main mkdir -p ./site touch ./db.csv -touch ./links.txt rm ./site/*.html ./site/rss [[ $1 == -n ]] && { @@ -212,10 +211,10 @@ while read -r line; do title=$(cut -s -d, -f4- <<< "$line") class="read" - if [[ -z $title ]]; then - title=$(grep "${link}," ./db.csv | cut -d, -f4-) + if [[ -z $title || $title == "~" ]]; then + [[ -z $title ]] && title=$(grep "${link}," ./db.csv | cut -d, -f4-) - [[ -z $title && $offline == false ]] && { + [[ -z $title && $offline == false || $title == "~" ]] && { printf "getting title for %s...\n" "$link" >&2 title=$(curl -L -s "$link" \ @@ -267,7 +266,7 @@ while read -r line; do cat ./site/link.html >> ./site/index.html print_rss_link "$title" "$link" "$date" >> ./site/rss -done < "${1:-./links.txt}" +done < "${1:-/dev/stdin}" rm ./site/link.html diff --git a/todo.txt b/todo.txt @@ -1,3 +1,3 @@ -- [ ] add public/private bookmarks -- [ ] add sites for tags +- [x] add public/private bookmarks +- [x] add sites for tags - [x] newest first