https://github.com/crutchy-/test/blob/master/karma_published.php
bacon+
(only single +/- to differentiate from bender)
~karma bacon
~rainbow pretty text
etc
todo: quotes
no more searching
reset color:
~color -1
bold white:
~color 00
change color per mirc values: http://www.mirc.com/colors.html
~color 01
thru
~color 15
requote last in weird and wonderful ways (or show about):
~
bot doesn't quote itself (shows about)
atm only verbs ending in "ing" and a small set of nouns recognised, but this will grow
if you're interested in contributing (even just to the arrays) have a squiz at:
https://github.com/crutchy-/test/blob/master/bacon.php
anyone new to git, have a squiz at http://wiki.soylentnews.org/wiki/User:Crutchy#Git.2FGitHub
you can also edit directly on github (ideally only for simple changes such as additions to arrays).
todo: add collective noun substitution
todo: add ability to append arrays from within irc
thanks heaps mrbluze... ideas man and english extraordinaire
https://github.com/crutchy-/test/blob/master/crunch.php
designed to quote either the last thing said by a nick or the last thing said by a nick containing a search query
usage:
~
quotes a little about string including github source link
~q or ~quit
tells bot to quit
~find nick
quotes last thing said by nick (in local recorded log files)
~find nick query
quotes last thing said by nick that contains query (in local recorded log files)
code is fairly short and (hopefully) sweet. no comments sorry.
TODO: search online logs @ http://logs.sylnt.us/
i was inspired to work on this after i saw mention of piping irc to the wiki @ http://wiki.soylentnews.org/wiki/CommunitySupport#Projects
it's been tested some but is still a work in progress.
getting around the anti-spam/anti-bot features of wiki is something i'll have to consult a wizard on.
https://github.com/crutchy-/test/blob/master/bot.php
i'm not a professional programmer so it probably sucks.
any criticisms etc are welcome, and if i can be bothered i may even take them on board, or you can do a pull request if you feel like having a play.
this is my first open source code file :-)
some some notes & snippets from fun with the chat bots in IRC.
times are australian eastern daylight saving time.
[22:25] <@aqu4> crutchy: s/tim/blaat/
[22:27] <crutchy> $sr /i/u/s
[22:27] <@aqu4> s/u/i/
[22:27] <SedBot> <aqu4> /taalb/mit/s :yhctirc[22:31] <NCommander> O_o;
[22:34] <crutchy> $sr /O_o/o_O/s :rednammoCN
[22:34] <@aqu4> NCommander: s/O_o/o_O/
[22:34] <SedBot> <aqu4> <NCommander> o_O;[22:39] <crutchy> $sr /O_o/o_O/s :rednammoCN ## yas sb/
[22:39] <@aqu4> /bs say ## NCommander: s/O_o/o_O/$sr ++nocab
/bs say ## $sr ++nocab
/bs say ## bacon++yet to try (bender+aqu4+sedbot?):
xyz say first: bacon++
/bs say ## $sr /--/++/s :zxy
Currently trying to learn how to use git and github.
http://wiki.soylentnews.org/wiki/index.php/User:Crutchy#Git.2FGitHub
An idea that came to mind during talk about Soylent hosting on IRC today.
Thanks to Titanium, prospectacle, stderr, useless, swiss, FoobarBazbot and MrBluze for a lively discussion :-)
It started with:
[19:43] * crutchy wonders if a distributed service could be developed... divide the load, build in redundancy and if anyone's host goes down others will pick up the slack
Time is AEDT
The idea has been developed a little bit further since the IRC discussion.
General System
==============
- independent of DNS
- with a distributed model anyone can volunteer to host a node (no single person relied on to front hosting costs)
- system consists of a network of apache host nodes set up by volunteers willing to cover the costs of their host, and users connect to the web service using their web browser with the remote host selected by a launcher program
Host Node
=========
- not required to access web service (only for those who choose to offer to host)
- apache web server configured for web service (mysql, mod_perl, etc as required)
- must periodically execute a script (using crontab?) that requests nodelist from listed nodes and updates local nodelist as required (adds/removes based on some kind of agreement algorithm)
- must respond to nodelist requests from launchers, but can be isolated php/pl/etc script and need not be built into hosted service
- must contain scripts to synchronize data and site source code updates securely with other nodes as required (this will be the tricky bit)
Launcher
========
- user executes launcher to access web service
- no gui
- executable or source downloaded from trusted location (such as debian repository or github) along with nodelist containing one or more known host IP addresses
- purpose is to select a remote host node and open web browser pointed to selected remote host IP address
- before opening browser, a nodelist request is sent to every host in local nodelist, and local nodelist is updated in same way as server nodelist is updated (see above)
- possibly a simple settings file if required
- could be a bash script for Linux and a small Delphi or C program for Windows
On IRC there was concern expressed about security and verification of host nodes.
Since you're using a browser as a client (and all the security features that come with) and you're only receiving normal http responses (otherwise your browser would throw an error), there's only so much bad stuff a host node can do.
Worst case scenario might be that it redirects to goat.cx or some site with driveby downloads (which most browsers will block anyway).
If required a trusted network of host nodes could be formed using signed certificates (perhaps using OpenSSL).
Nodelists may not be that big since there isn't likely to be a huge number of hosts for the same service (such as SoylentNews) but if need be the list could be gzipped. As mentioned earlier, the tricky bit will be synchronizing website data and service application source code, but I don't think it is an insurmountable challenge.
edit: data could be distributed, but would need to be synchronized on all host nodes (the tricky bit mentioned above)
edit: thinking about data synchronizing... would either require modification of the service application to execute a script when data is changed (and script would do the work of sending data to other hosts) or a shell script with a loop that checks for changes to data file timestamps and if change is detected send data files to other hosts. for max efficiency it would be ideal just to post a single mysql insert/modify query whenever data changes, but that would require integration into the main application (slashcode in Soylent's case). you don't want to be sending entire database files around the place whenever there is a change. a good place to start might be to host the data on one or two high performance 'supernodes' until an improved synch system can be developed.
Wonder how much I would have to bribe someone to get an insanely high user number. Some number in the hundreds of billions would do. Trillions or more would be better, but it would need to be in scientific notation. Damn near NO ONE would actually count the zeros. Errr - wait - there probably are anal retentive geeks out there. Or obsessive compulsive nerds. Yeah, some few would count the digits.
Anyway - with some crazy high number, I can post from the far distant future. Infuriating nonsense, like, "Yes, Apple is still around today. They haven't innovated anything for centuries though. About all that's left of Apple, is their manufacturing facility in orbit around Mars, where they make a few specialty items for the Chinese Space Marines."
had a go at scripting a little quick & dirty irc bot for soylent
requires sic (http://tools.suckless.org/sic)
if you're using debian: sudo apt-get install sic
#!/bin/bash
chan="#test"
log="test.log"
pipe="log-pipe"trap "rm -f $pipe" EXIT
if [[ -f $log ]]; then
rm $log
fiif [[ ! -p $pipe ]]; then
mkfifo $pipe
fisubstr="End of /MOTD command"
joined=""sic -h "irc.sylnt.us" -n "log-bot" <> $pipe | while read line; do
if [[ -n "$line" ]]; then
echo $line >> $log
fi
if [[ -z "$joined" ]] && [[ -z "${line##*$substr*}" ]]; then
joined="1"
echo ":j $chan" > $pipe
fi
doneexit 0
also posted on the wiki @ http://wiki.soylentnews.org/wiki/index.php/User:Crutchy#IRC_logging_bot