Created
March 9, 2024 00:48
-
-
Save gjbianco/e4ade802363d68b4335468b9c3b13dd4 to your computer and use it in GitHub Desktop.
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 | |
cat <<EOF | |
<?xml version="1.0" encoding="utf-8"?> | |
<rss version="2.0"> | |
<channel> | |
<title>Guy's Too Read</title> | |
<link>example.com</link> | |
<description>a too-read Guy's to-read list</description> | |
EOF | |
while read l; do | |
t=`curl "$l" -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)' || echo $l` | |
echo " <item>" | |
echo " <title>$t</title>" | |
echo " <link>$l</link>" | |
echo " </item>" | |
done <$1 | |
cat <<EOF | |
</channel> | |
</rss> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment