add script flag to build to make a twt, update email address

This commit is contained in:
Iris Lightshard 2021-06-25 23:42:59 -06:00
parent eff63b8b95
commit 1c0bd73dab
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
3 changed files with 30 additions and 6 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# Lint # Lint
clang-format -i main.c clang-format -i main.c
@ -26,6 +26,9 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wuninitializ
# echo "$(du -b ./main | cut -f1) bytes written" # echo "$(du -b ./main | cut -f1) bytes written"
# Run # Run
if [ "$1" = "-t" ]; then
shift && ./tw.sh $@
fi
./main ./main
./thumbnailer.sh build ./thumbnailer.sh build

16
main.c
View file

@ -23,7 +23,7 @@ WITH REGARD TO THIS SOFTWARE.
"<a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a>&gt;<br/>"\ "<a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a>&gt;<br/>"\
"artist, programmer, philosopher<br/><br/>"\ "artist, programmer, philosopher<br/><br/>"\
"verify my signature: <a href='/serv/signingKey.pub'>signing public key</a><br/>"\ "verify my signature: <a href='/serv/signingKey.pub'>signing public key</a><br/>"\
"send me an encrypted message: <a href='/serv/encryptionKey.pub'>encrypted public key</a>" "send me an encrypted message: <a href='/serv/encryptionKey.pub'>encryption public key</a>"
#define SITEROOT "../www/" #define SITEROOT "../www/"
#define MAINCSS "/new.css" #define MAINCSS "/new.css"
#define FRONTCSS "/front.css" #define FRONTCSS "/front.css"
@ -80,7 +80,7 @@ int gettwtxt(FILE* f) {
char line[256]; char line[256];
char datebuf[16] = {0}; char datebuf[16] = {0};
char msgbuf[240] = {0}; char msgbuf[240] = {0};
char* l; char *l, *d, *m;
FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r"); FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r");
scat(buf, "<div id='twtxtFeed'><h2>recent activity:</h2>"); scat(buf, "<div id='twtxtFeed'><h2>recent activity:</h2>");
@ -102,6 +102,14 @@ int gettwtxt(FILE* f) {
scat(buf, ": "); scat(buf, ": ");
scat(buf, msgbuf); scat(buf, msgbuf);
scat(buf, "<br/>"); scat(buf, "<br/>");
d = datebuf;
while (*d) {
*d++ = 0;
}
m = msgbuf;
while (*m) {
*m++ = 0;
}
i++; i++;
} }
scat(buf, "<a href='/twtxt.txt'>see all</a>"); scat(buf, "<a href='/twtxt.txt'>see all</a>");
@ -322,9 +330,7 @@ int fpfooter(FILE* f, char* name, char* path) {
fputs("<footer>", f); fputs("<footer>", f);
if (!ismetanav(name)) { if (!ismetanav(name)) {
fpedited(f, path); fpedited(f, path);
fputs( fputs("contact: <a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a> ", f);
"contact: <a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a> ",
f);
fputs("(<a href='keys.html'>keys</a>)<br/>", f); fputs("(<a href='keys.html'>keys</a>)<br/>", f);
} }
fputs( fputs(

15
tw.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
twtxt=../www/twtxt.txt
twt(){
self=$(mktemp)
new=$(mktemp)
echo "$(date -Is)\t$@" > ${self}
cat ${self} ${twtxt} > ${new}
cp ${new} ${twtxt}
rm ${new}
rm ${self}
}
twt $@