Correct Jekyll feed parsing
jekyll is dumb. there I said it.
This commit is contained in:
parent
c68d139a47
commit
31b7529778
18
opml/opml.sh
18
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 "<title" |
|
||||
sed "0,/<title>/ s/<title>//" |
|
||||
sed "0,/<title/ s/<title type=\"html\">//" | sed "s/<\/title>.*//" |
|
||||
sed "s/.*<title>//" | sed "s/.*<title type=\"html\">//" |
|
||||
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/
//")
|
||||
|
||||
sprinkle=$(echo -e "$germ" |
|
||||
awk '/<title/{title=1}
|
||||
title{sub(/.*<title[^>]*>/,"");
|
||||
if(sub(/<\/title>.*/,"")) title=0;
|
||||
print;}
|
||||
!title{exit}')
|
||||
# RSS
|
||||
else
|
||||
sprinkle=$(echo -e "$germ" | grep -m 1 "<title>" |
|
||||
sed "s/.*<title>//" | sed "s/<\/title>.*//" |
|
||||
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/
//")
|
||||
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | tr -d \\n)
|
||||
pearl=$(echo -e "$germ" | grep -m 1 "<link>" |
|
||||
sed "s/.*<link>//" | sed "s/<\/link>.*//" | sed "s/
//")
|
||||
sed "s/.*<link>//" | sed "s/<\/link>.*//" | tr -d \\n)
|
||||
luncheon=$(echo -e "$germ" | grep -m 1 "<description>" |
|
||||
sed "s/.*<description>//" | sed "s/<\/description>.*//" |
|
||||
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/
//")
|
||||
sed "s/<!\[CDATA\[//" | 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,
|
||||
|
|
Loading…
Reference in New Issue