hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 9409ac7e6c029193474b36516dca24db4ac15e49
parent 128d81e1406faf850475891db455434106dc521f
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Fri, 10 Mar 2017 09:05:59 -0500

Posse and send webmention trough webmention-go and Bridgy.

Diffstat:
Mposse | 31++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/posse b/posse @@ -7,26 +7,39 @@ # cat example.md | bti --action update # 1) Get the most recent file in the note/ directory. -dir="./content/note" +# dir="./content/note" -unset -v latest_note +# unset -v latest_note -IFS= read -r -d '' latest_note \ - < <(find "$dir" -type f -printf '%T@ %p\0' | sort -znr) +# IFS= read -r -d '' latest_note \ +# < <(find "$dir" -type f -printf '%T@ %p\0' | sort -znr) -latest_note=${latest_note#* } # remove timestamp + space +# latest_note=${latest_note#* } # remove timestamp + space # 2) With Pancdoc remove the YAML header into that file -posse_note=$(basename "${latest_note%.*}.tweet.md") +# posse_note=$(basename "${latest_note%.*}.tweet.md") -pandoc --wrap=none "$latest_note" -o "$posse_note" +# pandoc --wrap=none "$latest_note" -o "$posse_note" # 3) Tweet the file content with the bti command. -cat "$posse_note" | bti --action update +# cat "$posse_note" | bti --action update # 4) Remove the *.tweet.md -rm "$posse_note" +# rm "$posse_note" # Ok, but i'm thinking it would be better if i use webmention-go with # the last URL of the fakestache.db ... and run it after the deploy # process. + +unset -v first_db_line + +# Read the first line (last entry) of the fakestache.db +read -r first_db_line < fakestache.db + +# Extract the permalink +last_permalink=$(echo "$first_db_line" | cut -d "|" -f 3) + +# Then send it to the webmention-go app +webmention "$last_permalink" + +# Bridgy will do the rest.