/eval-bot

evaluate arbitrary javascript and post the result on the fediverse!

Primary LanguageJavaScriptGNU Affero General Public License v3.0AGPL-3.0

eval

give an authenticated fediverse client to arbitrary javascript

the bot: @eval@beeping.town
the script: https://pad.cosine.online/p/eval

behavior

let's call this repository the 'runner.' it is surprisingly (and increasingly) minimal

every 4 hours* the script is evaluated, and in the returned context, interval() is called with no arguments

every time a notification is received the script is evaluated, and in the returned context, notification(noti) is called, where noti is the received notification

in either case, if an error is thrown either while evaluating the script or while calling the relevant function, the error and stack trace are normalized, stringified, and posted as a public status by the account

* excluding times between 1am and 7:59am Eastern Time

script context

the following identifiers (and some irrelevant ones) are provided to the script's evaluation context:

etherpad

the bot's script is on a text pad at https://pad.cosine.online/p/eval

this is one document on an instance of etherpad lite hosted on my server, which allows you to collaborate live with folks!

the instance

the actual runner, and therefore script, is running Node, v16.3.0

as of this writing, the script follows a general design strategy of placing functions that return text (hijinks) into an array/object, out of which one is selected at random, and has its result posted. this has proven effective for collaboration