Skip to content

Instantly share code, notes, and snippets.

@robertzk
Last active August 29, 2015 14:27
Show Gist options
  • Save robertzk/0847d3c6826d44756229 to your computer and use it in GitHub Desktop.
Save robertzk/0847d3c6826d44756229 to your computer and use it in GitHub Desktop.
Setting up your hipchat token.

Setting up your Hipchat API token

First, visit the Hipchat account API page. You will have to login with you avantcredit.com hipchat account.

Scroll down and create your Hipchat token with the following permissions:

Create New Token

The token should appear in the list above. Copy the token, and then run the following line from your terminal (with the token replaced by your token):

echo "options(hipchat.api_token = '7PBfjOzd6tvewlHBAxsJxZImRU6ONHe2kjBYvpCQ')" >> ~/.Rprofile

The Rprofile file allows you to customize your R session at startup. By executing the above, you have ensured that the hipchat.api_token R global option is set during startup.

Finally, install the hipchat package, and you should be able to send messages on Hipchat from within the R console! Run the R code below to install the hipchat package.

source("~/.Rprofile") # Ensure your hipchat token is loaded.

if (!is.element("devtools", utils::installed.packages()[, 1])) {
  install.packages("devtools")
}

if (!is.element("hipchat", utils::installed.packages()[, 1])) {
  devtools::install_github("robertzk/hipchat")
}

You can check that things work correctly by hipchatting the Analytics room:

hipchat::hipchat("Analytics", "Hello, world.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment