Created
September 17, 2023 15:33
-
-
Save rey/c261c6afbd2775504eef27103d2122ff to your computer and use it in GitHub Desktop.
Revisions
-
rey created this gist
Sep 17, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/bin/bash # yq: # snap install yq # waybackpy: # pip3 install waybackpy file="${1}" post_layout=$(yq --front-matter=extract '.layout' ${file}) if [[ "${post_layout}" == "link" ]]; then echo "This looks link a link post!" post_link=$(yq --front-matter=extract '.link' ${file}) waybackpy --url "${post_link}" --save else echo "This post is not a link post!" fi