X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/day?a=blobdiff_plain;f=processor%2Fmetadata%2Fdefault.feed_snippet.do;h=9a9b7ab218ea96a5adcf4bc17e37b5d8f41f5bae;hb=c841d869ec1eaa8107bece1385038339aa6cfd3e;hp=b09eaa056e62537b10df8f8cd987554943b1e151;hpb=b86576c5f61cff36c80c9e0efd9d77f50dac745b;p=redo-blog
diff --git a/processor/metadata/default.feed_snippet.do b/processor/metadata/default.feed_snippet.do
index b09eaa0..9a9b7ab 100644
--- a/processor/metadata/default.feed_snippet.do
+++ b/processor/metadata/default.feed_snippet.do
@@ -1,28 +1,37 @@
#!/bin/sh
+# Handle URL from .links file.
+prep_url() {
+ url=$(escape_html "$1")
+ printf "\n" "$url"
+}
+
# Pull in dependencies.
. ../helpers.sh
src_file=$(get_source_file "$1")
-uuid_file="${1%.feed_snippet}.uuid"
-redo-ifchange "$uuid_file"
+meta_file="${1%.feed_snippet}.automatic_metadata"
+redo-ifchange "$meta_file"
intermediate_file="${1%.feed_snippet}.intermediate"
redo-ifchange "$intermediate_file"
+replies_file="${src_file%.*}.links"
+redo-ifchange "$replies_file"
# Get variables, write entry.
-html_file=`escape_url "${src_file%.*}.html"`
-html_file=${html_file#*/}
-lastmod=`stat -c%y "$src_file"`
-lastmod_rfc3339=`date -u "+%Y-%m-%dT%TZ" -d "$lastmod"`
-published=`stat -c%y "$uuid_file"`
-published_rfc3339=`date -u "+%Y-%m-%dT%TZ" -d "${published}"`
-title=`read_and_escape_file "$intermediate_file" | head -1`
-uuid=`read_and_escape_file "$uuid_file" | head -1`
-body=`read_and_escape_file "$intermediate_file" | sed 1d`
+html_file=$(escape_url "${1%.feed_snippet}.html")
+lastmod=$(get_lastmod_date_from_meta_file "$meta_file")
+lastmod_rfc3339=$(date -u "+%Y-%m-%dT%TZ" -d "@$lastmod")
+title=$(read_and_escape_file "$intermediate_file" | head -1)
+uuid=$(get_uuid_from_meta_file "$meta_file")
+published_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
+published_rfc3339=$(date -u "+%Y-%m-%dT%TZ" -d "@${published_unix}")
+body=$(read_and_escape_file "$intermediate_file" | sed 1d)
+replies=$(while read line; do prep_url "$line"; done < "$replies_file")
printf "\n"
printf "%s\n" "$title"
printf "urn:uuid:%s\n" "$uuid"
printf "%s\n" "$lastmod_rfc3339"
printf "%s\n" "$published_rfc3339"
-printf "\n" "$(get_basepath)" "${html_file}"
-printf "\n%s\n\n" "$body"
+printf "" "$(get_basepath)" "${html_file}"
+printf "%s" "$replies"
+printf "\n\n%s\n\n" "$body"
printf "\n"