-
-
Save planeth44/7b9abdd91dc2a19e5ae84c04860d53ef to your computer and use it in GitHub Desktop.
webmention bash script
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 characters
| #!/bin/bash | |
| # from https://indieweb.org/webmention-implementation-guide#One-liner_webmentions | |
| echo -n "Enter your source url: " | |
| read source | |
| echo -n "Enter your target url: " | |
| read target | |
| # echo "$(tput setaf 1)Shirt red $(tput setaf 4) Pant blue" | |
| echo "" | |
| echo "" | |
| echo -n "$(tput setaf 1)source is: $(tput setaf 4)$source" | |
| echo "" | |
| echo -n "$(tput setaf 1)target is: $(tput setaf 4)$target" | |
| echo "" | |
| echo "" | |
| echo -e "\e[1;37;46mAll is good ?[Y or O]\e[0m" | |
| read OK | |
| if [ "$OK" == "Y" || "$OK" == "O" ] | |
| then | |
| curl -i -d "source=$source&target=$target" `curl -i -s $target | grep 'rel="webmention"' | sed 's/rel="webmention"//' | grep -o -E 'https?://[^ ">]+' | sort | uniq` | |
| echo "DONE" | |
| else | |
| echo "ABORT" | |
| fi | |
| exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment