Compare commits

...

4 Commits

Author SHA1 Message Date
Case Duckworth 4028897f6e Add makefile 2022-08-08 23:09:57 -05:00
Case Duckworth 18fd5efa6c Fix quoting 2022-08-08 23:09:51 -05:00
Case Duckworth 94d96ca4c4 Further awkify 2022-08-08 23:09:38 -05:00
Case Duckworth 31b7529778 Correct Jekyll feed parsing
jekyll is dumb.  there I said it.
2022-08-08 22:32:39 -05:00
3 changed files with 33 additions and 22 deletions

4
opml/Makefile Normal file
View File

@ -0,0 +1,4 @@
build:
./opml.sh make "the most delicious opml on friend planet" \
"barista" "barista@me.acdw.net" "https://git.tilde.town/mio/opml" \
./mug.of.opml

View File

@ -1,12 +1,12 @@
<?xml version=1.0?> <?xml version="1.0"?>
<opml version=2.0> <opml version="2.0">
<head> <head>
<title>the most delicious opml on friend planet</title> <title>the most delicious opml on friend planet</title>
<dateCreated>Mon, 08 Aug 2022 07:42:14 +0000</dateCreated> <dateCreated>Tue, 09 Aug 2022 04:08:29 +0000</dateCreated>
<dateModified>Mon, 08 Aug 2022 07:42:14 +0000</dateModified> <dateModified>Tue, 09 Aug 2022 04:08:29 +0000</dateModified>
<ownerName>acdw</ownerName> <ownerName>barista</ownerName>
<ownerEmail>acdw@acdw.net</ownerEmail> <ownerEmail>barista@me.acdw.net</ownerEmail>
<ownerId>https://git.acdw.net/sfeed/</ownerId> <ownerId>https://git.tilde.town/mio/opml</ownerId>
<docs>http://dev.opml.org/spec2.html</docs> <docs>http://dev.opml.org/spec2.html</docs>
</head> </head>
<body> <body>
@ -39,8 +39,8 @@ xmlUrl="https://brainshit.fr/rss" htmlUrl="https://brainshit.fr" description="Si
xmlUrl="https://tilde.town/~lucidiot/ideas/rss.xml" htmlUrl="https://tilde.town/~lucidiot/ideas/" description="random ideas published by ~lucidiot"/> xmlUrl="https://tilde.town/~lucidiot/ideas/rss.xml" htmlUrl="https://tilde.town/~lucidiot/ideas/" description="random ideas published by ~lucidiot"/>
<outline type="rss" text="#fridaypostcard" <outline type="rss" text="#fridaypostcard"
xmlUrl="https://tilde.town/~lucidiot/fridaypostcard.xml" htmlUrl="http://tilde.town/~jumblesale/fp.html" description="to contribute, share a link to an image on irc with the text #fridaypostcard. updated every friday"/> xmlUrl="https://tilde.town/~lucidiot/fridaypostcard.xml" htmlUrl="http://tilde.town/~jumblesale/fp.html" description="to contribute, share a link to an image on irc with the text #fridaypostcard. updated every friday"/>
<outline type="rss" text="m455's blog" <outline type="rss" text="m455.casa"
xmlUrl="https://m455.casa/feed.rss" htmlUrl="https://m455.casa" description="A blog about programming and documentation."/> xmlUrl="https://m455.casa/feed.rss" htmlUrl="https://m455.casa" description="RSS feed for m455.casa"/>
<outline type="rss" text="Rick Carlino's Blog" <outline type="rss" text="Rick Carlino's Blog"
xmlUrl="https://rickcarlino.com/rss/feed.rss" htmlUrl="https://rickcarlino.com" description="The personal blog of Rick Carlino, a software tinkerer."/> xmlUrl="https://rickcarlino.com/rss/feed.rss" htmlUrl="https://rickcarlino.com" description="The personal blog of Rick Carlino, a software tinkerer."/>
<outline type="rss" text="lipu pi jan Niko" <outline type="rss" text="lipu pi jan Niko"

View File

@ -93,22 +93,25 @@ orange_pecan_mousse() {
if [ -z "$is_rss" ]; then if [ -z "$is_rss" ]; then
# Select the first instance of the opening tag, mark the closing tag, # Select the first instance of the opening tag, mark the closing tag,
# trim off everything after and before the tags, clean inner html # trim off everything after and before the tags, clean inner html
sprinkle=$(echo -e "$germ" | grep -m 1 "<title" | sprinkle=$(echo -e "$germ" |
sed "0,/<title>/ s/<title>//" | awk '/<title/{title=1}
sed "0,/<title/ s/<title type=\"html\">//" | sed "s/<\/title>.*//" | title{
sed "s/.*<title>//" | sed "s/.*<title type=\"html\">//" | match($0,/<title[^>]*>/);
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/ //") $0 = substr($0, RSTART+RLENGTH);
if(sub(/<\/title>.*/,"")){title=0;seen=1;}
print;}
/<\/title/{seen=1}
!title&&seen{exit}')
# RSS # RSS
else else
sprinkle=$(echo -e "$germ" | grep -m 1 "<title>" | sprinkle=$(echo -e "$germ" | grep -m 1 "<title>" |
sed "s/.*<title>//" | sed "s/<\/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>" | 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>" | luncheon=$(echo -e "$germ" | grep -m 1 "<description>" |
sed "s/.*<description>//" | sed "s/<\/description>.*//" | sed "s/.*<description>//" | sed "s/<\/description>.*//" |
sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | sed "s/ //") sed "s/<!\[CDATA\[//" | sed "s/\]\]>//" | tr -d \\n)
fi fi
# Guess the website URL from the feed URL to avoid parsing # Guess the website URL from the feed URL to avoid parsing
# strings with multiple link tags and no newline delimiters, # strings with multiple link tags and no newline delimiters,
@ -120,10 +123,14 @@ orange_pecan_mousse() {
test -z "$luncheon" && luncheon="No description available" test -z "$luncheon" && luncheon="No description available"
echo -e "$__pecan" >>"$_wheremug.tmp" echo -e "$__pecan" >>"$_wheremug.tmp"
sed -i "s|{{sprinkle}}|$sprinkle|g" "$_wheremug.tmp" awk '{
sed -i "s|{{seed}}|$seed|g" "$_wheremug.tmp" gsub(/{{sprinkle}}/,"'"$sprinkle"'");
sed -i "s|{{pearl}}|$pearl|g" "$_wheremug.tmp" gsub(/{{seed}}/,"'"$seed"'");
sed -i "s|{{luncheon}}|$luncheon|g" "$_wheremug.tmp" gsub(/{{pearl}}/,"'"$pearl"'");
gsub(/{{luncheon}}/,"'"$luncheon"'");
print;
}' <"$_wheremug.tmp" >"$_wheremug.tmp.tmp" &&
mv "$_wheremug.tmp.tmp" "$_wheremug.tmp"
sprinkle="" sprinkle=""
pearl="" pearl=""
luncheon="" luncheon=""