main
commit
961d1f418d
|
@ -0,0 +1,4 @@
|
||||||
|
src/interesting.txt
|
||||||
|
dist/feed.xml
|
||||||
|
dist/index.html
|
||||||
|
dist/interesting.txt
|
|
@ -0,0 +1,8 @@
|
||||||
|
WALUIGI PUBLIC LICENSE
|
||||||
|
Version 1, June 2024
|
||||||
|
|
||||||
|
Copyright (C) 2024 dozens@tilde.team
|
||||||
|
|
||||||
|
This work may be freely copied, distributed, and modified but only if you send
|
||||||
|
a picture of yourself gloating in victory and celebrating with a rose in your
|
||||||
|
hands or teeth to the author. Wah.
|
|
@ -0,0 +1,36 @@
|
||||||
|
# STORY JOURNAL MICROBLOG
|
||||||
|
|
||||||
|
> The Most Interesting Thing That Happened To Me Today Was...
|
||||||
|
|
||||||
|
## ABOUT
|
||||||
|
|
||||||
|
it's kind of what it says on the tin.
|
||||||
|
this is a microblog of daily reflections.
|
||||||
|
reflecting on what was the most story-worthy,
|
||||||
|
interesting thing that happened that day.
|
||||||
|
|
||||||
|
## MOVIVATION
|
||||||
|
|
||||||
|
- recall interesting things that happened
|
||||||
|
so you have stories to tell during smalltalk
|
||||||
|
and at social functions.
|
||||||
|
|
||||||
|
- prime your mind for noticing things as they happen,
|
||||||
|
and thinking of them as interesting
|
||||||
|
|
||||||
|
## GETTING STARTED
|
||||||
|
|
||||||
|
- CLI: copy `bin/interesting` to somewhere in your PATH.
|
||||||
|
e.g., `~/bin/interesting`.
|
||||||
|
|
||||||
|
- start daily blogging with `interesting bla bla bla`.
|
||||||
|
or:
|
||||||
|
|
||||||
|
```
|
||||||
|
cat<<EOF | interesting
|
||||||
|
bla bla bla bla bla bla
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
- run `bin/build.sh` to build `index.html` and `feed.xml`.
|
||||||
|
do whatever you want with it.
|
|
@ -0,0 +1,125 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
HEAD=$(
|
||||||
|
cat<<'EOF'
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>The Most Interesting Thing That Happened To Me Today</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="alternate" type="application/rss+xml" href="rss.xml" title="dozens interesting microblog">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
max-width: 80ch;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 1rem;
|
||||||
|
font-size: 18pt;
|
||||||
|
}
|
||||||
|
dd {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body {
|
||||||
|
background: #15191d;
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
body a {
|
||||||
|
color: #809fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="text-align: right;">
|
||||||
|
<p>
|
||||||
|
subscribe:
|
||||||
|
<a href="interesting.txt">twtxt</a>
|
||||||
|
<a href="feed.xml">rss</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
dozensweb:
|
||||||
|
<a href="https://tilde.town/~dozens/webring/dozens/index.html?name=interesting&dir=prev">prev</a>
|
||||||
|
<a href="https://tilde.town/~dozens/webring/dozens/index.html">all</a>
|
||||||
|
<a href="https://tilde.town/~dozens/webring/dozens/index.html?name=interesting&dir=next">next</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<h1>Story Journal Microblog</h1>
|
||||||
|
<p>by dozens</p>
|
||||||
|
<details>
|
||||||
|
<summary>About</summary>
|
||||||
|
<p>
|
||||||
|
There's this guy. I don't remember his name. But he is a storytelling competition winner many times over.
|
||||||
|
And somebody interviewed him and asked how he comes up with such great stories.
|
||||||
|
And his answer was, everyday you write down the most story-worthy thing that happened to you that day.
|
||||||
|
The most interesting thing that happened to you.
|
||||||
|
</p>
|
||||||
|
</details>
|
||||||
|
<h2>The most interesting / story-worthy thing that happened to me today was ...</h2>
|
||||||
|
<dl>
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
BUTT=$(
|
||||||
|
cat<<'EOF'
|
||||||
|
</dl>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
exec > dist/index.html
|
||||||
|
echo "$HEAD"
|
||||||
|
IFS=$'\t'
|
||||||
|
cat src/interesting.txt | sed '/^#/d' | tac |\
|
||||||
|
while read STAMP BODY; do
|
||||||
|
d=`gdate --date "$STAMP" +'%Y-%m-%d'`
|
||||||
|
echo "<dt id="$STAMP">$d <a href="#$STAMP">¶</a></dt><dd>$BODY</dd>"
|
||||||
|
done
|
||||||
|
echo "$BUTT"
|
||||||
|
|
||||||
|
|
||||||
|
##########
|
||||||
|
# rss time
|
||||||
|
##########
|
||||||
|
|
||||||
|
|
||||||
|
TOP=$(
|
||||||
|
cat<<'END-OF-TOP'
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<title>dozens interesting microblog</title>
|
||||||
|
<link>http://tilde.town/~dozens/interesting/</link>
|
||||||
|
<description>dozens interesting microblog</description>
|
||||||
|
<atom:link rel="self" type="application/rss+xml" href="http://tilde.town/~dozens/interesting/feed.xml"/>
|
||||||
|
<generator>/bin/sh</generator>
|
||||||
|
END-OF-TOP
|
||||||
|
)
|
||||||
|
|
||||||
|
MIDDLE()(
|
||||||
|
TIME="$1"
|
||||||
|
CONTENT="$2"
|
||||||
|
PUBDATE=`gdate --date "$STAMP" -R`
|
||||||
|
cat<<END-OF-MIDDLE
|
||||||
|
<item>
|
||||||
|
<title>${CONTENT:0:40}...</title>
|
||||||
|
<link>http://tilde.town/~dozens/interesting/#$TIME</link>
|
||||||
|
<guid>http://tilde.town/~dozens/interesting/#$TIME</guid>
|
||||||
|
<pubDate>$PUBDATE</pubDate>
|
||||||
|
<description>
|
||||||
|
<![CDATA["
|
||||||
|
$CONTENT
|
||||||
|
"]]>
|
||||||
|
</description>
|
||||||
|
</item>
|
||||||
|
END-OF-MIDDLE
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
exec > dist/feed.xml
|
||||||
|
echo "$TOP"
|
||||||
|
IFS=$'\t'
|
||||||
|
cat src/interesting.txt | sed '/^#/d' | tac |\
|
||||||
|
while read STAMP BODY; do
|
||||||
|
MIDDLE "$STAMP" "$BODY"
|
||||||
|
done
|
||||||
|
echo "</channel></rss>"
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
input=""
|
||||||
|
output=$HOME/blogs/interesting/src/interesting.txt
|
||||||
|
|
||||||
|
if [[ -p /dev/stdin ]]
|
||||||
|
then
|
||||||
|
input="$(cat -)"
|
||||||
|
else
|
||||||
|
input="${@}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${input}" ]]
|
||||||
|
then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$(date -Iseconds) ${input}" >> $output
|
|
@ -0,0 +1,15 @@
|
||||||
|
# list all recipes
|
||||||
|
default:
|
||||||
|
just --list --unsorted
|
||||||
|
|
||||||
|
# build html
|
||||||
|
build:
|
||||||
|
cp src/interesting.txt dist && sh bin/build.sh
|
||||||
|
|
||||||
|
# build and upload
|
||||||
|
all:
|
||||||
|
just build && just up
|
||||||
|
|
||||||
|
# upload
|
||||||
|
up:
|
||||||
|
rsync -zaP dist/* tilde:public_html/interesting/
|
Loading…
Reference in New Issue