Giter Site home page Giter Site logo

irced's Introduction


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:

  • add_nick: Add nickname/user info
  • irced: Putting the R into IRC
  • irc_connect: Create an IRC server object
  • post_message: Post an IRC message
  • set_channel: Set channel info

TODO

  • Bundle in libircclient
  • Finish Windows port
  • Separate out IRC server connection bits from the message sending bits (to support piping)
  • Finish code for channel authentication
  • Finish code/docs for SASL authentication
  • Finish code for user authentication
  • Add code to support writing an IRC bot in R

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.")

irced's People

Contributors

hrbrmstr avatar

Stargazers

Frans van Dunné avatar J. Hathaway avatar Robert M Flight avatar Zeyad Deeb avatar John Harrison avatar  avatar Humbert avatar Thomas J. Leeper avatar

Watchers

 avatar James Cloos avatar Robert M Flight avatar  avatar

irced's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.