diff --git a/opml/opml.sh b/opml/opml.sh
index 38eac8a..92a0a49 100755
--- a/opml/opml.sh
+++ b/opml/opml.sh
@@ -93,22 +93,22 @@ orange_pecan_mousse() {
if [ -z "$is_rss" ]; then
# Select the first instance of the opening tag, mark the closing tag,
# trim off everything after and before the tags, clean inner html
- sprinkle=$(echo -e "$germ" | grep -m 1 "
/ s///" |
- sed "0,///" | sed "s/<\/title>.*//" |
- sed "s/.*//" | sed "s/.*//" |
- sed "s///" | sed "s/
//")
-
+ sprinkle=$(echo -e "$germ" |
+ awk '/]*>/,"");
+ if(sub(/<\/title>.*/,"")) title=0;
+ print;}
+ !title{exit}')
# RSS
else
sprinkle=$(echo -e "$germ" | grep -m 1 "" |
sed "s/.*//" | sed "s/<\/title>.*//" |
- sed "s///" | sed "s/
//")
+ sed "s///" | tr -d \\n)
pearl=$(echo -e "$germ" | grep -m 1 "" |
- sed "s/.*//" | sed "s/<\/link>.*//" | sed "s/
//")
+ sed "s/.*//" | sed "s/<\/link>.*//" | tr -d \\n)
luncheon=$(echo -e "$germ" | grep -m 1 "" |
sed "s/.*//" | sed "s/<\/description>.*//" |
- sed "s///" | sed "s/
//")
+ sed "s///" | tr -d \\n)
fi
# Guess the website URL from the feed URL to avoid parsing
# strings with multiple link tags and no newline delimiters,