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-irkit

v0.2.0

Published

A Hubot script to control IRKit the hackable remote controller.

Downloads

21

Readme

hubot-irkit

Build Status npm-version

A Hubot script to control IRKit the hackable remote controller.

me > hubot ir register device XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX office-amp
hubot > Registering client: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX as office-amp...
hubot > Device: office-amp is successfully registered.
me > hubot ir register message poweron for office-amp
hubot > Waiting for IR message...
hubot > Message: poweron for office-amp is successfully registered.
me > hubot ir send message poweron for office-amp
hubot > Sending poweron for office-amp..
hubot > Successfully sent message: poweron for office-amp

Commands

hubot ir register device <client_token> <client_name> - Register IRKit device
hubot ir unregister device <client_name> - Unregister IRKit device
hubot ir show <client_name> - Show IRKit device
hubot ir list devices - List IRKit device
hubot ir register message <message_name> for <device_name> - Register IR message
hubot ir unregister message <message_name> for <device_name> - Unregister IR message
hubot ir list messages for <device_name> - List IR messages
hubot ir send message <message_name> for <device_name> - Send IR message

Installation

  1. Add hubot-irkit to dependencies.
npm install --save hubot-irkit
  1. Update external-scripts.json
["hubot-irkit"]

Configurations

HUBOT_IRKIT_HTTP=1

Enable webhook routing to trigger message.

HUBOT_IRKIT_HTTP_METHOD

HTTP method to route webhook. Default is GET. Supports GET POST PUT DELETE.

Setup

1. Purchase and setup your IRKit

If you don't have one yet, purchase IRKit from Amazon Affiliate link :yen:.

Set it up following the official instruction and connect to your local network (may be contained in the package).

2. Retrieve your client token

As descried in the official document, retrieve your instance name with dns-sd command.

dns-sd -B _irkit._tcp

You may get the response like this

Browsing for _irkit._tcp
DATE: ---Mon 09 Jun 2014---
 1:22:43.931  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
 1:22:44.104  Add        2   4 local.               _irkit._tcp.         irkita1EC
 1:22:44.105  Add        2   4 local.               _irkit._tcp.         iRKit928E

Pick an instance name and append .local suffix and inspect the address.

dns-sd -G v4 irkita1EC.local
DATE: ---Mon 09 Jun 2014---
 1:24:14.248  ...STARTING...
Timestamp     A/R Flags if Hostname                               Address                                      TTL
 1:24:14.524  Add     2  4 irkita1ec.local.                       192.168.1.29                                 10

Then request client token.

curl -i -XPOST http://192.168.1.29/keys
HTTP/1.0 200 OK
Access-Control-Allow-Origin: *
Server: IRKit/1.3.6.0.g96a9b88
Content-Type: text/plain

{"clienttoken":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}

3. Register your IRKit device

Finally you can register your IRKit device to your Hobot's brain.

hubot ir register device XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX office-amp

Webhook

Enable webhooks by setting HUBOT_IRKIT_HTTP to 1.

/irkit/messages/:deviceName/:messageName

HTTP method is GET by default. Set HUBOT_IRKIT_HTTP_METHOD to change.

heroku config:set HUBOT_IRKIT_HTTP=1 HUBOT_IRKIT_HTTP_METHOD=PUT
$ curl -XPUT -i http://myhubot.herokuapp.com/irkit/messages/living/roomba

HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
X-Powered-By: hubot/Hubot
Content-Type: text/html; charset=utf-8
Content-Length: 2
Date: Sat, 06 Sep 2014 17:41:26 GMT
Via: 1.1 vegur

OK

Author

Atsushi Nagase

License

MIT License