-- Leo's gemini proxy
-- Connecting to republic.circumlunar.space:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
I've been getting very excited about keybase.io recently, not least because it offers secure conversation, and you can have bots.
I wrote a quick bot to simulate Arnold Schwarzenegger which I thought I'd share to demonstrate how easy it is. It is based on the keybase command line tool (which comes with the desktop client as standard) and jq, the brilliant command-line JSON manipulator.
For this to work, you need to have the keybase command installed and working, and you need jq.
Here's the bot:
#!/bin/bash CHANNEL=mychannel keybase chat api-listen | while read L; do { OUT=$(jq --raw-output 'select(.type == "chat")|select(.msg.content.text.body|startswith("!arnie "))| .msg.content.text.body | "*" + ltrimstr("!arnie ") + "*"' <<< "$L") if [ "${OUT}" != "" ]; then { keybase chat send "${CHANNEL}" "${OUT}" }; fi }; done
and here's it working:
andy> !arnie Do eet do eet now!!! andy> Do eet do eet now!!!
Note: here the bot is pretending to be me. To do this nicely, you will want a different account for the bot, but you get the idea.
Obviously, I am now working on a comprehensive bot framework in Rust. Watch this space.
Originally posted at 2019-02-14 09:08:17+00:00. Automatically generated from the original post : apologies for the errors introduced.
-- Response ended
-- Page fetched on Sun May 19 03:47:57 2024