add script flag to build to make a twt, update email address
This commit is contained in:
parent
eff63b8b95
commit
1c0bd73dab
3 changed files with 30 additions and 6 deletions
5
build.sh
5
build.sh
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Lint
|
||||
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"
|
||||
|
||||
# Run
|
||||
if [ "$1" = "-t" ]; then
|
||||
shift && ./tw.sh $@
|
||||
fi
|
||||
./main
|
||||
./thumbnailer.sh build
|
||||
|
||||
|
|
16
main.c
16
main.c
|
@ -23,7 +23,7 @@ WITH REGARD TO THIS SOFTWARE.
|
|||
"<a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a>><br/>"\
|
||||
"artist, programmer, philosopher<br/><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 MAINCSS "/new.css"
|
||||
#define FRONTCSS "/front.css"
|
||||
|
@ -80,7 +80,7 @@ int gettwtxt(FILE* f) {
|
|||
char line[256];
|
||||
char datebuf[16] = {0};
|
||||
char msgbuf[240] = {0};
|
||||
char* l;
|
||||
char *l, *d, *m;
|
||||
FILE* twtxt = fopen(SITEROOT "twtxt.txt", "r");
|
||||
|
||||
scat(buf, "<div id='twtxtFeed'><h2>recent activity:</h2>");
|
||||
|
@ -102,6 +102,14 @@ int gettwtxt(FILE* f) {
|
|||
scat(buf, ": ");
|
||||
scat(buf, msgbuf);
|
||||
scat(buf, "<br/>");
|
||||
d = datebuf;
|
||||
while (*d) {
|
||||
*d++ = 0;
|
||||
}
|
||||
m = msgbuf;
|
||||
while (*m) {
|
||||
*m++ = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
scat(buf, "<a href='/twtxt.txt'>see all</a>");
|
||||
|
@ -322,9 +330,7 @@ int fpfooter(FILE* f, char* name, char* path) {
|
|||
fputs("<footer>", f);
|
||||
if (!ismetanav(name)) {
|
||||
fpedited(f, path);
|
||||
fputs(
|
||||
"contact: <a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a> ",
|
||||
f);
|
||||
fputs("contact: <a href='mailto://nilix@nilfm.cc'>nilix@nilfm.cc</a> ", f);
|
||||
fputs("(<a href='keys.html'>keys</a>)<br/>", f);
|
||||
}
|
||||
fputs(
|
||||
|
|
15
tw.sh
Executable file
15
tw.sh
Executable 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 $@
|
Loading…
Reference in a new issue