Here in Blighty, we're having a General Election on Thursday 7th May.
This time around, the Official Monster Raving Loony Party has conceded that it will probably lose votes to UKIP.
Oh dear.
blockquote {border-left:3px solid #0F0 !important; padding-left:1em !important;}
/* Submissions */
.data .status0 {background:#FFF !important; color:#080 !important;}
.data .status0 a {color:#080 !important;}
.data .status0 a:visited {color:#0A0 !important;}
.data .status0 a:hover {color:#0C0 !important;}
.data .status1 {background:#800 !important;}
.data .status2 {background:#256625 !important;}
currently developing a sort of api for the exec irc bot.
bit of background: exec is run as a single php script process in a terminal, which connects to the soylent irc server, but when commands are triggered from the irc channels, the bot spawns child processes to service the commands. command aliases are mapped to shell commands using templates to substitute data from irc (such as nick, channel, message, etc). child processes are usually passed data using command line arguments, and communication to/from child processes and the bot process is facilitated through child process stdin and stdout pipes.
eg: typing "~rainbow ciri is a butthole" triggers the shell command: php scripts/rainbow.php 'ciri is a butthole'
the bot creates a named pipe and dumps a bunch of data to it in response to events, such as when a child process is started, when a message is received from a child process stdout pipe, when a message is received from the irc server, etc.
the named pipe can be read by something simple like cat, but i've written another php script to read it. this reader script also has a tcp socket server which allows yet another program to access the data stream (remotely even), such as telnet.
this is fine for just reading data, but i wanted to be able to command the bot remotely using this api. this is achieved by starting the reader script as a child process of the bot, which then offers the reader script the same methods taken advantage of normal scripts through stdin and stdout. a couple of specific stdout handlers were added to the bot script for acquiring specific data, but the reader also has direct access to irc and other functionality using existing stdout handlers (/IRC and /INTERNAL being the main handlers, used to output a raw message to the irc socket and perform an internal command respectively).
with two-way communication established between a tcp socket in the reader script and the main bot process, with event data streaming, i wanted to make a pretty gui application that i could see what is going on, since the bot terminal can be a bit crazy (each irc message can result in output filling half the terminal or more, due to internal events and data messages).
my tool of choice is delphi 7 pro, so i've made a little app called 'execstat' that connects to the reader socket server and reads the data streaming from it and enables commands to be sent. its pretty basic at this stage, but hope to develop it into something that i can use to easily see which scripts are running, which buckets are being get/set, which channels the bot is in, which commands are being triggered by who and where, etc. also important will be the ability to trigger kill commands for scripts, since currently to kill a script i have to go to a private channel, get a list of running processes (using the ~ps alias) and enter the pid in a ~kill alias command. not hard, but would be nice if i could just click a button in a gui. lazy++
the socket in the delphi app reads in its own thread, and uses a synchronized event handler to give data to the main application thread.
my current work revolves around rolling my own unserializer classes to parse the php serialized arrays, which is necessary to be able to get anything useful from the data streaming into the socket.
this whole setup is probably way overcomplicated and rediculous, but i enjoy working on it. moar_complexity++
per previous journal i set up a simple channel relay feed to enable status messages for ncommander's nethack stream, but since there has been a little bit of talk about other games (including dungeon crawl stone soup) i turned the feed code into something more generic so that other feeds could be added easily. now there's feeds for the rodney bot from #nethack (freenode) to #nethack (soylent), as well as feeds for a couple of bots from ##crawl (freenode) to #crawl (soylent). the code to dispatch messages containing keywords has also been made generic, so that if ncommander plays again his deaths can be easily dispatched to #soylent for our amusement :p
code for this feature can be found here: https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/activity.php#L86-L115
another feature that was briefly mentioned in my last journal has been developed further to enable limited two way communication between someone in a soylent irc channel and someone in a freenode irc channel.
to send a message to a channel on the freenode irc network (that an exec minion resides in with forwarding enabled) an authorized user on the soylent irc network in a channel with exec can type "#freenode_channel > message" and the message will be relayed. if you're in the freenode landing channel on the soylent irc network (#freenode) you'll be able to see any replies pop up in there, but it can easily get hidden amongst all the traffic from other channels, so to enable a 10 minute automated relay to a different soylent irc channel, type "#freenode_channel > freenode_nick, message" and for the next 10 minutes anything that freenode_nick says in #freenode_channel will be relayed to the originating soylent channel. only messages prefixed with "#freenode_channel >" will be relayed from soylent to freenode so soylentils can still talk without anyone on freenode hearing, but using the prefix on the soylent end (not required on freenode end) enables two-way communication. the relay lasts for 10 minutes, but can be easily renewed as many times as you want by typing another message (on soylent) in the form "#freenode_channel > freenode_nick, message". if you want to see a list of currently active relays, type ".relays" and it will list freenode_nick, freenode_channel, soylent channel and time remaining (in minutes). use of this feature is limited to a list of nickserv accounts.
code for this feature can be found here: https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/activity.php#L133-L213
re-enabled the ~submit alias so that instead of just pasting a link to irc, you can also (with smallest amount of additional effort) share it with SN users not on irc. syntax is really simple: ~submit %url%
just submits the description or og:description meta tag content along with the link, so makes for a pretty lame submission but its better than nothing at all (editors can always reject it if it sucks too much)
during NCommander's NetHack thing i tweaked the freenode relay script to output messages by the Rodney irc bot in the freenode #nethack channel to our #soylent channel when NCommander died in the game. also made it so that anything Rodney said was output to our local #nethack channel so that NetHack fans can see what's going on without connecting to freenode directly.
developed some macro functionality to enable authorized irc users to shorten otherwise long exec commands into shorter equivalents. came in handy for simplifying control of the freenode relay bot.
also made a compound macro (using exec's internal_macro lib function) to make it easy to talk through the relay bot from the SN irc channels to freenode channels.
we get a bit of spam occasionally in the wiki, and chromas is diligently blanking it out (despite not having authority to delete articles) as a means of spam control. a script has been developed to make it a little easier for him (and a couple of others in a list of authorized nickserv accounts). a spam page in the wiki can now be cleared with ".spamctl %page title%"
http://sylnt.us/exec
http://sylnt.us/execsrc
broke out ircd work into a separate github repo. currently working on ability to connect multiple times to a network with the same nick. idea is that if there are a few servers on the network you could connect to each of them, and then if one disconnects you can still use the other (redundant) connections. authentication of subsequent connections to the same nick is done using a connection id appended to the username field (username sent out doesn't include the connection id though).
the server is at a point where i can connect to it with hexchat a couple of times (server spits out a connection id on first connect, and i just paste that to the end of the username in second connection). i can then join a channel from either connection, which automatically joins for the other connection (weird to watch). then i can chat and the chat appears on both connections. its pretty funky to play with.
if the project goes anywhere (unlikely) it might be ideal to have a client that handles the redundant connections for you automatically rather than having to establish separate connections manually and have each one take up room in the server list. netsplits could be a thing of the past.
prolly will try to make it ts6 and rfc compatible, but still early stages.
Irritable Duncan "Trust-me-I-know-what-I'm doing" Syndrome reckons that, when he and the rest of the Conservative Party are re-elected in this May's General Election, he'll make £12 billion (US$17.8 billion) of welfare cuts but he won't tell us before the election what these cuts will be, Allegedly, it's "Not relevant."
There aren't that many poor, sick, disabled and needy left un-kicked, but it's highly amusing that thousands of people in one of the world's most highly-developed countries are having to resort to food banks.
Goodness only knows how much worse it will get if the loony right UKIP get some seats. Anyone but an imbecile can see that they'd vote with the Conservatives on many issues or even form a coalition.
So hurry up and vote Tory to keep the hopeless, sneering socialists down.
God save the Queen etc.
Our IRC (http://irc.sylnt.us/) has a #comments channel that you can join to see an hourly feed of all new comments that appear in reply to SoylentNews stories.
This has been around for a while, but over the weekend a new feature was added to allow more personalized comment feeds.
Filtered feeds can be dispatched either as a PM to your nick or to a channel of your choosing. To dispatch to a channel you just need to make sure the exec bot resides in that channel (you can command it to join by visiting #soylent and typing "~join #mychannel").
There are two types of filters; cid and pattern
The cid filter is useful if you would like a feed of all responses in a specific comment thread. You simply add a filter that points to the parent comment cid and the bot will feed all child comments that appear.
Using a pattern filter enables you to feed comments that meet certain criteria. There are a number of fields you can match, and any new comment that matches the criteria in a filter will be output to the target nick/channel.
You can add multiple filters to track multiple cid's and/or comments that match multiple patterns.
The following commands can be performed in any channel where the exec bot resides:
~comments filter-add %id% %target% %cid%
~comments filter-add %id% %target% %field% %pattern%
~comments filter-delete %id%
~comments filter-list
%id% = unique name to identify filter (cannot contain spaces)
%target% = channel or nick to send filtered comments to
%cid% = SoylentNews comment id to track ("cid" parameter in uri)
%field% = any of user, uid, score, score_num, subject, title, comment_body (title refers to the story title)
%pattern% = regexp pattern for use with preg_match (surrounding #'s are added by the script)
examples:
- if you wanted a feed for all replies to this comment: http://soylentnews.org/comments.pl?sid=6634&cid=160651
you would use this command:
~comments filter-add my_test_filter #mychannel 160651
- if you wanted a feed with any comments that contain "systemd" you could use this command:
~comments filter-add systemd_filter_1 #mychannel comment_body systemd
and if you also wanted comments with "systemd" in the subject, add another filter:
~comments filter-add systemd_filter_2 #mychannel subject systemd
--
source (unlicensed): https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/comment_feed.php
I don't spend much money, and I seldom give any to online people. But - yeah, I'm aware that Soylent is in need of money. Then I saw it - an UNOBTAINIUM KEY CHAIN!! I'll be the first kid on my block to acquire unobtainium! I'll save my pennies and nickles, and discretely order a few more of these over the next months - and I can then build my UNOBTAINIUM BOMB!
Ooooh, I haven't been this excited since I ordered that little battery powered submarine when I was six or seven years old!
been mucking around with a little website thing intended to be sort of similar to SoylentNews/Pipedot/etc
it's written in php and is intended to be very simple
site (not yet fully functional) is here: http://news.my.to/
sample story with a bunch of nested test comments here: http://news.my.to/story/1
code for site is here: https://github.com/crutchy-/exec-irc-bot/tree/master/website/news.my.to
so far it has basic rewrite rules, templating for html, uses pdo, no classes (procedural only)
code is unlicensed (https://github.com/crutchy-/exec-irc-bot/blob/master/unlicense.txt)