all repos — honk @ 69b127209089ee044dfacea6bad70b41c6427de3

my fork of honk

qotd
Ted Unangst tedu@tedunangst.com
Tue, 08 Aug 2023 16:17:47 -0400
commit

69b127209089ee044dfacea6bad70b41c6427de3

parent

c75610f568c1a4609e5d5339fec2ffe1abbc5385

2 files changed, 36 insertions(+), 0 deletions(-)

jump to
M bloat.gobloat.go

@@ -14,3 +14,38 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. package main + +import ( + "io" + "net" + "time" +) + +func qotd() { + var qotdaddr string + getconfig("qotdaddr", &qotdaddr) + if qotdaddr == "" { + return + } + s, err := net.Listen("tcp", ":8017") + if err != nil { + return + } + for { + c, err := s.Accept() + if err != nil { + time.Sleep(time.Second) + continue + } + honks := getpublichonks() + for _, honk := range honks { + if !firstclass(honk) { + continue + } + io.WriteString(c, honk.Noise) + io.WriteString(c, "\n") + break + } + c.Close() + } +}
M web.goweb.go

@@ -2656,6 +2656,7 @@ go enditall()

go redeliverator() go tracker() go bgmonitor() + go qotd() loadLingo() emuinit()