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

harman-kardon-hubapp-api

v0.0.1

Published

API and demo to work with Harman-Kardon Web Hub App

Downloads

3

Readme

Harman/Kardon Hup App Simple API and Demo

API and demo to work with Harman-Kardon Web Hub App

Install

npm install harman-kardon-hubapp-api

Usage

The library provides functions to generate RESTful API endpoints. Some values set below were specific to the hackathon event from which this library was built; you will need to get these values (see the demo video referenced in the Description below).

var hk = require('harman-kardon-hubapp-api');
var request = require('request');

var hub = {                              // Harman/Kardon Hub Variables
  "SessionID":"1000",                    // Default value of the SessionID
  "DeviceID":"2586126661808",            // This was the DeviceID of the device we used at our Hackathon
  "PersistentID":"7180490900718530992",  // This was the PersistentID of the first song in our media list 
  "baseUrl":'http://10.0.1.9:8080/'      // This was the URL assigned when opening the Hub app on our iPhone
};

request(hk.initCmd(hub), function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body);
    hub.SessionID = JSON.parse(body).SessionID;   // resets the SessionID based on initialization call
  }
  
  // ... continue with other RESTful API calls ...
}

Description

This api and demo was built for an ATT Hackathon in San Diego in October 2015. One of the vendors participating in the demo was Harman/Kardon. Harman/Kardon provided wi-fi enabled speakers (specifically the Omni10) to hackers to see what kinds of cool things could be accomplished using their APIs and SDKs. There was a RESTful API accessible via the HKWebHubApp, as well as Android and iOS APIs. My team chose to utilize the HKWebHub App for "quick-and-dirty" hacking. We recommend going this route to get started, because it took us less than an hour to get it working initially. (Note: As of this writing, you must have an iOS device to use the HKWebHubApp).

Register as a developer: http://developer.harman.com/site/global/home/p_home.gsp

Here's a link to find the HKWebHub App (near the bottom): http://developer.harman.com/site/global/developer_tools/sample_apps/index.gsp

Here's a link to the developer tools (check out the WebHub App Demo video first!): http://developer.harman.com/site/global/developer_tools/wirelesshd_sdk_overview/index.gsp

Demos

You will need to tinker with a few parameters and setting to get these demos set up for your needs. They are mostly just here to give you an idea of how to use the library.

Sensors Demo

This demo was built to modify the song being played and adjust the volume dependent on sensor inputs posted to a server. You should be able to run it with liveDemo=false. It demonstrates many of the things you would need to do to get up and running.

node runDemo.js

Volume Control Demo

This demo was built when debugging how to use the volume control REST-ful API calls

node test_volume_control.js

Troubleshooting tips

If you run into problems, console.log the commands that the library is generating and try running them from a curl statement or from the browser. It helped me find typos and peculiarities of the interface. Here's an example:

console.log(hk.setVolumeCmd(hub,vol));