Skip to content

Instantly share code, notes, and snippets.

@rey
Created September 17, 2023 15:33
Show Gist options
  • Save rey/c261c6afbd2775504eef27103d2122ff to your computer and use it in GitHub Desktop.
Save rey/c261c6afbd2775504eef27103d2122ff to your computer and use it in GitHub Desktop.
Dirty POC script to send Jekyll link posts to the internet archive
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment