--- title: Better RSS and Hell summary: HELL category: 💻 publishedAt: 1641466800000 --- I think I've reached the limits of `bash`. I just wrote the grossest script to embed my posts into RSS `` tags. This is so people can read my posts *in* their reader without coming to my site. Behold. Filth: ```sh RSS_ITEMS=() echo "Creating RSS feed..." cd "$BLOG_LOCATION" for file in $BLOG_LOCATION/*.md; do NAME="$(basename "$file")" TITLE="$(grep "^title:" "$file" | sed 's/[^ ]* //')" EDIT_TIME="$(git log -1 --pretty="format:%ci" "$file" | cut -d" " -f2)" PUB_DATE="$(date -d"${NAME%$FILE_PREFIX.md}" +"%a, %d %b %Y ${EDIT_TIME:-$RSS_TIME} $TIMEZONE")" DRAFT="$(grep "^draft:" "$file" | sed 's/[^ ]* //')" GUID="$(echo "$FILENAME $PUB_DATE" | md5sum | cut -f1 -d" ")" FILE_CONTENT=$(cat "${PARENT_PATH}out/blog/${NAME%$FILE_PREFIX.md}.html") FIXED_IMAGES=$(echo "$FILE_CONTENT" | sed "s/ ${GUID} ${TITLE} https://${DOMAIN_NAME}/blog/${NAME%$FILE_PREFIX.md}.html *}]]> ${PUB_DATE} ") fi done cd "$PARENT_PATH" RSS_STRING=$(printf '%s' "${RSS_ITEMS[@]}" | tr -d '\n') RSS_OUTPUT=" pfy.ch https://pfy.ch pfych blogs $RSS_STRING " echo "$RSS_OUTPUT" > ./out/rss.xml ``` I hate it. I will probably rewrite this script in something else now tbh. Idk what language though. However! Now at least my site is more RSS friendly. Genuinely think more sites should use RSS.