tildelog/lib/get_post_author.sh

8 lines
241 B
Bash

#!/usr/bin/env bash
# Return the post author
#
# $1 the html file
get_post_author() {
awk '/<div class="subtitle">.+/, /<!-- text begin -->/{if (!/<div class="subtitle">.+/ && !/<!-- text begin -->/) print}' "$1" | sed 's/<\/div>//g'
}