Skip to content

Instantly share code, notes, and snippets.

@gjbianco
Created March 9, 2024 00:48
Show Gist options
  • Save gjbianco/e4ade802363d68b4335468b9c3b13dd4 to your computer and use it in GitHub Desktop.
Save gjbianco/e4ade802363d68b4335468b9c3b13dd4 to your computer and use it in GitHub Desktop.
#!/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