Skip to content

Instantly share code, notes, and snippets.

@maujim
Created March 20, 2024 22:51
Show Gist options
  • Save maujim/a3d3cf78dbc4efd1c3a1de315d20c6e5 to your computer and use it in GitHub Desktop.
Save maujim/a3d3cf78dbc4efd1c3a1de315d20c6e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
target_file="$1"
target_file_name="$(basename "$1")"
echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<opml version="2.0">'
echo '<opml version="2.0">'
echo "<head> <title>rss feed from $target_file_name</title> </head>"
echo '<body>'
# remove empty lines, and comments (starting with '#')
sed -e '/^ *$/d' -e '/^ *#/d' "$target_file" | sed 's/.*/<outline xmlUrl="&"\/>/'
echo '</body>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment