if you're in IRC and you wanna bring up a wiki section for discussion, type:
[[title|section]]
to output the wiki page section
eg:
[[IRC|Chat bot (Python)]]
outputs:
<exec> ELIZA module that uses Futurama personalities (to match the bot's current nick) Modify bot logging to match existing formats (mIRC preferably)
<exec> http://wiki.soylentnews.org/wiki/IRC#Chat_bot_.28Python.29
one of the things i'm working lately is a bitbucket feed for soylent irc (similar to the #github feed)
it currently polls the events api url for one repo (uselessd) every 5 mins and spits out a message to #github if new code is pushed
i'm still trying to figure out how to relate changesets to commits listed in push events so that i can list affected files similar to the github feed. neither the atlassian api help nor google have been very helpful.
--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/bitbucket_feed.php
http://sylnt.us/exec
The long and short of it is, there won't be one. We're pushing it until January due to me and PJ being occupied too much with holiday and Life stuff.
What you can look forward to:
Not a final version and we haven't touched meta-moderation yet but this will cut down on the echo chamber effect, mod bombing, and lay some groundwork for combating spam as well.
Currently if you put html entities in and hit preview they get transformed into literal characters. There's also wackiness if you try to put double quotes in a submission title. I hate this, you hate this, and it needed to stop so most of the code for it is already done and being tested on dev.
There is really no reason to have http links in the rss feed rather than https links, so they're changing. I'm also doing my best to get them to encode only the necessary characters and display properly but it seems like no two readers display the same.
Occasionally I get bored and do up a theme instead of actually working. This time around we have the VT100 and the OMG PWNIES themes. These are actually pretty easy to do. Feel free to mod and submit your own. All it takes is a custom stylesheet if you're okay with reusing existing favicons/logos.
We're adding standard support for sub/sup/abbr/strike tags. We're also adding support for the custom tags sarc/sarcasm and two forms of a "user" tag.
Bunch of minor bugs, some of which you would have never seen because they were on admin pages.
I think that's all but I'm not sure what the last one that went into our point release after the 14.12 update was.
the "~x" alias allows a bot operator to create and manage scripts from within IRC (dubbed "live scripts")
scripts created using this alias are stored in a bucket by the bot instead of a file
the handler uses php's eval to run live scripts
to prevent anyone from executing arbitrary commands on the bot host, a whois command is issued to verify that the NickServ account of the user of the ~x alias is the bot operator (by settling the userlist parameter of the alias definition line to "@")
the general form of the command is:
~x %action% [%param%] [%code%]
in a nutshell the possible actions and params are:
"global on|off" (enables or disables all live scripts)
"kill" (a shorcut for disabling all live scripts)
"enable %script-name%" (enables an individual live script)
"disable %script-name%" (disables an individual live script)
"delete-script %script-name%" (deletes a live script from memory)
"open %script-name%" (opens a live script for editing in the active channel)
"close" (closes the currently open live script in the active channel)
"code" (outputs a line-numbered code listing of the currently open live script in the active channel)
"list" (outputs a listing of available live scripts, and highlights enabled scripts)
"replace [L]%line-number% %old-code%|%new-code%" (replaces a line of code in the currently open live script)
"delete-line [L]%line-number%" (deletes a line of code in the currently open live script)
"insert [L]%line-number% %code%" (inserts a line of code in the currently open live script)
"add %code%" (adds a line of code to the currently open live script)
import and export (from/to file) actions are also proposed but not yet implemented.
live scripts have access to common lib functions used by other scripts, and also have direct access to $nick, $dest (channel), $trailing. the privmsg lib function doesn't work for live scripts as the live script handler is triggered internally by the bot using a registered privmsg event handler, so to privmsg the channel that the sender ($nick) is in you simply call pm($dest,"message) instead.
when a new live script is created, it must be enabled before it will run, but once enabled any changes will come into affect immediately.
whilst the code is currently limited to php, it could potentially be adapted to execute code in other languages using their command-line interpreters. it also doesn't have to be limited to code. it could potentially be used to collaborate on lines of non-executing text (such as for collaborative editing of SN submissions). with some tweaks it could be possible to collaborate on code as well, with other users being able to add/edit/delete lines but requiring the operator to re-enable the script for changes to come into effect.
ps: exec also now supports init: in-script directives, similar to startup: and exec: directives, which will increase self-containment of scripts further.
--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/scripting.php
http://sylnt.us/exec
http://sylnt.us/execsrc
can now specify commands to run at startup inside scripts in a similar fashion to alias definitions
startup commands are read from one or more directives in the main exec file:
startup ./scripts
this uses the same (now more generalized) code as alias definitions; recursively searching files in the specified path for "startup:" directives (similar to "exec:" directives). like exec directives, startup directives must occur at the start of a line, so should be put in multi-line comment (below exec directive usually).
startup directives are stored until the bot identifies with NickServ, at which point the "<startup>" reserved alias is triggered followed by commands from startup directives run.
startup commands are like what you would type in IRC channels, but in this case they are intercepted by the bot and don't get transmitted to the IRC server. you can have any number of startup directive lines in a file.
example (php exec script):
/*
exec:~privmsg-internal|5|0|0|1||INTERNAL||0|php scripts/privmsg.php %%trailing%% %%nick%% %%dest%%
startup:~privmsg-internal register-events
*/
startup directives are good for triggering event registration handlers in the script, and pretty much makes a script self-contained (for now anyway).
--
http://sylnt.us/exec
http://sylnt.us/execsrc
commit for this feature: https://github.com/crutchy-/exec-irc-bot/commit/a3bb41c0d6eced1b6ec6e6573370f3db7129ccaa
added an include feature when loading/rehashing the main exec file (https://github.com/crutchy-/exec-irc-bot/blob/master/exec.txt).
syntax is:
include %filename%
%filename% can be a path, which will recurse to include any readable files contained.
it can also be a relative path (to the main bot script, irc.php):
include ./scripts
when including a file, the bot will read the contents of the file and look for any line beginning with "exec:" and will treat whatever follows as an alias definition (exec line).
to use this feature in a script (without borking the script) you just enclose the line in a comment. the exec directive must be on its own line, so it won't work as an EOL comment.
this means an alias definition (exec line) can be stored in individual scripts in any language that supports multi-line comments.
example (from https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/irciv/irciv.php):
/*
exec:~civ|30|0|0|1||||0|php scripts/irciv/irciv.php %%nick%% %%trailing%% %%dest%% %%start%% %%alias%% %%cmd%%
*/
if you create a new script, you can either add an include directive in the main exec file and issue a ~rehash command in irc, or if you already have a directory in the main exec file you can just issue a ~rehash after you save your script.
the aim of this feature is to enable scripts to become more self-contained.
anyway, thanks for reading and have a great weekend.
A quick and dirty voting script has been developed for use in Soylent IRC.
Voting syntax for users identified with NickServ is:
~vote <poll_id> <option>
More info on how to use it can be found here:
http://sylnt.us/vote
There is now a feed set up in the #github channel on SoylentNews IRC for reporting push, pull and issue events for SoylentNews/slashcode, and push events for some other SN user and staff repos.
The feed works by querying GitHub API URLs every 15 minutes.
moved nick tracking inside bot process cos i was having all sorts of grief trying to make it work the way i wanted in a separate script. seems to work pretty smoothly now, and i don't need to worry about pausing/unpausing the socket reader.
starting fidgeting with irciv again now that i got some reliable generic authentication features. trying to consolidate all actions into a single alias and get player authentication back up.
event response is a bit more readily available to scripts with event handler registration. the bot keeps track of command/handler pairs in an encoded bucket, and on various events the register is queried and any handlers that exist are executed. this opens up possibility to have the bot trigger a script on an event without using the exec.txt file, and as the register is a bucket it can also be edited from within irc. will have to think about what sort of security risks this might pose, but ability to manually edit buckets is limited to privileged users so not overly worried. irciv will register event handlers on startup to manage player tracking, which was formerly done in cmd.php (eventually want to remove cmd.php, to be replaced with registered event handlers in startup.php). some templates are supported in event handlers; %%nick%%, %%trailing%%, %command%% and %%params%%, which are replaced with actual values when the handled event occurs
a little SN funding feed has been enabled. polls home page slashbox every 15 mins. message appears in #soylent if funding amount increases
comment feed has been changed to use simpler xml feed and only top 20 articles are scraped, as i found the latter 30 articles never got that many comments (assuming probably cos they fall off the SN front page). /join #comments
--
http://sylnt.us/exec
https://github.com/crutchy-/exec-irc-bot
exec now has a basic nick tracking script that hooks the join, nick, quit, kick, part and 353 events. this feature is similar but nowhere near as complete as xchat's (or $insert_client_here's) user list.
it has lead to the addition of internal stdout commands for retrieving a space-delimited listing of bucket indexes, and commands for pausing and unpausing the processing of irc data, to prevent corruption of bucket data that might occur due to multiple processes triggered by irc events trying to read/write to the same bucket(s) simultaneously.
nick tracking enables scripts to find out what nicks are in a given channel or what channels a given nick are in. currently only channels shared with the bot are tracked, but with additional event hooks (such as a whois 319 numeric) additional channel info can be tracked.
with proposed addition of whois account querying (330 numeric) by the user tracking script, other scripts will be able to authenticate instructions with a simple function call.
the irciv script was originally designed with player authentication using the 330 nickserv account numeric. however it was messy, with irciv-specific code sprinkled throughout the main event handling script (cmd.php). the generalized tracking system will give all scripts access to the same user data via a small set of lib functions.
--
http://sylnt.us/exec
https://github.com/crutchy-/exec-irc-bot