README.md

irced : \ˈɜrkt\

verb

  1. What users in your IRC channels will become if you send too many automated messages.

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:

TODO

Installation

devtools::install_github("hrbrmstr/irced")

Working on Bots (subject to change)

    library(irced)
    library(jsonlite)

    # probably should/will turn this into an S4 or reference class
    my_bot <- function(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(params[1])
        } else {
          res <- sample(c(FALSE, TRUE), 1)
          if (res) {
            bot_cmd_list(params[1])
          } else {
            bot_cmd_msg(params[1], sprintf("Something  %d", sample(100, 1)))
          }
        }
      }

    }

    irc_connect("irc.rud.is") %>% 
      set_channel("#builds") %>% 
      start_bot("my_bot")

Notifications (subject to change)

library(irced)

# current verison
packageVersion("irced")
irc_connect("irc.rud.is") %>% 
 set_channel("#builds") %>% 
 post_message("Finishing a build is important, but building is more important.")


hrbrmstr/irced documentation built on May 17, 2019, 5:09 p.m.