irced
: \ˈɜrkt\
verb
This is an Rcpp/C++11 package for hooking R up to the world of Internet Relay Chat (IRC).
It's uses libircclient
which is bundled in with the package.
Build systems such as 'Travic-CI' have many ways to notify users when jobs have completed including posting a message to an IRC channel. In similar form, there are many times when analyses or data cleaning/processing operations are long running tasks that operate in the background or on remote systems. Functions are provided to notify users of the status of these tasks via IRC.
Eventually, it will be possible to make a complete IRC bot in R, but that's a future feature add.
If you're looking to host your own IRC server, I've found ngircd
to be compact and easy to install/administer.
The API is is not set in stone as of yet so if you have any feature/API requests, please file an issue. This also means the API may change radically and break stuff.
Many thanks to @jeroenooms for his anticonf pattern/source.
The following functions are implemented:
add_nick
: Add nickname/user infopost_message
: Post an IRC messageset_channel
: Set channel infolibircclient
devtools::install_github("hrbrmstr/irced")
options(width=120)
library(irced) library(jsonlite) # probably should/will turn this into an S4 or reference class my_bot <- function(session, event, origin, params) { # pretty event console logging message( sprintf( "%s\n", toJSON( list( EVENT=unbox(event), ORIGIN=unbox(origin), PARAMS=params ), pretty=TRUE) ) ) if (event == "CHANNEL" & origin != "keryx") { if (params[2] == ">>QUIT") { bot_cmd_part(session, params[1]) } else { res <- sample(c(FALSE, TRUE), 1) if (res) { bot_cmd_list(session, params[1]) } else { bot_cmd_msg(session, params[1], sprintf("Something %d", sample(100, 1))) } } } } irc_server("irc.rud.is") %>% set_channel("#builds") %>% bot_connect() %>% start_bot("my_bot")
library(irced) # current verison packageVersion("irced")
irc_server("irc.rud.is") %>% post_message("#builds", "Finishing a build is important, but building is more important.")
library(irced) library(testthat) date() test_dir("tests/")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.