npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-hipchat-beta

v2.6.10

Published

A Hipchat adapter for Hubot

Downloads

23

Readme

hubot-hipchat

Quickstart: Hubot for HipChat on Heroku

This is a HipChat-specific version of the more general instructions in the Hubot wiki.

  1. From your existing HipChat account add your bot as a new user. Stay signed in to the account - we'll need to access its account settings later.

  2. Make sure native dependencies are installed:

     (e.g. OS X with brew)
     % brew install icu4c
     % brew link icu4c
    
     (e.g. Linux with apt-get)
     % apt-get install libexpat1-dev
     % apt-get install libicu-dev
  3. Install hubot from npm, if you don't already have it. Note the explicit version reference. The version # of hubot-hipchat is kept in line with hubot. If your hubot's version is greater than hubot-hipchat's, that means it hasn't been tested and may not work!

     % npm install --global coffee-script [email protected]
  4. Create a new hubot if necessary:

     % hubot --create <path>
  5. Switch to the new hubot directory:

     % cd <above path>
  6. Install hubot dependencies:

     % npm install
  7. Install the hipchat adapter:

     % npm install --save hubot-hipchat
  8. Edit Procfile and change it to use the hipchat adapter. You can also remove the -n Hubot arg as the bot will automatically fetch its @mention name from HipChat.

     web: bin/hubot --adapter hipchat
  9. Turn your hubot directory into a git repository:

     % git init
     % git add .
     % git commit -m "Initial commit"
  10. Install the Heroku command line tools if you don't have them installed yet.

  11. Create a new Heroku application and (optionally) rename it:

     % heroku create
     % heroku rename our-company-hubot
  12. Add Redis To Go to your Heroku app:

     % heroku addons:add redistogo:nano
  13. Configure it:

    You will need to set a configuration variable if you are hosting on the free Heroku plan.

     % heroku config:add HEROKU_URL=http://soothing-mists-4567.herokuapp.com

    Where the URL is your Heroku app's URL (shown after running heroku create, or heroku rename).

    Set the JID to the "Jabber ID" shown on your bot's XMPP/Jabber account settings:

     % heroku config:add HUBOT_HIPCHAT_JID="..."

    Set the password to the password chosen when you created the bot's account.

     % heroku config:add HUBOT_HIPCHAT_PASSWORD="..."

    If using HipChat Server Beta, you need to set xmppDomain to your server's domain. % heroku config:add HUBOT_HIPCHAT_XMPP_DOMAIN="..."

  14. Deploy and start the bot:

     % git push heroku master
     % heroku ps:scale web=1

    This will tell Heroku to run 1 of the web process type which is described in the Procfile.

  15. You should see the bot join all rooms it has access to (or are specified in HUBOT_HIPCHAT_ROOMS, see below). If not, check the output of heroku logs. You can also use heroku config to check the config vars and heroku restart to restart the bot. heroku ps will show you its current process state.

  16. Assuming your bot's name is "Hubot", the bot will respond to commands like "@hubot help". It will also respond in 1-1 chat ("@hubot" must be omitted there, so just use "help" for example).

  17. To configure the commands the bot responds to, you'll need to edit the hubot-scripts.json file (valid script names here) or add scripts to the scripts/ directory.

  18. To deploy an updated version of the bot, simply commit your changes and run git push heroku master again.

Bonus: Add a notification hook to Heroku so a notification is sent to a room whenever the bot is updated: https://www.hipchat.com/help/page/heroku-integration

Adapter configuration

This adapter uses the following environment variables:

HUBOT_HIPCHAT_JID

This is your bot's Jabber ID which can be found in your XMPP/Jabber account settings. It will look something like [email protected]

HUBOT_HIPCHAT_PASSWORD

This is the password for your bot's HipChat account.

HUBOT_HIPCHAT_ROOMS

Optional. This is a comma separated list of room JIDs that you want your bot to join. You can leave this blank or set it to "All" to have your bot join every room. Room JIDs look like "[email protected]" and can be found in the XMPP/Jabber account settings - just add "@conf.hipchat.com" to the end of the room's "XMPP/Jabber Name".

HUBOT_HIPCHAT_HOST

Optional. Use to force the host to open the XMPP connection to.

HUBOT_HIPCHAT_JOIN_ROOMS_ON_INVITE

Optional. Setting to false will prevent the HipChat adapter from auto-joining rooms when invited.

HUBOT_LOG_LEVEL

Optional. Set to debug to enable detailed debug logging.

HUBOT_HIPCHAT_XMPP_DOMAIN

Optional. Set to your server's domain if using HipChat Server Beta.

Running locally

To run locally on OSX or Linux you'll need to set the required environment variables and run the bin/hubot script. An example script to run the bot might look like:

#!/bin/bash

export HUBOT_HIPCHAT_JID="..."
export HUBOT_HIPCHAT_PASSWORD="..."

bin/hubot --adapter hipchat