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

daap

v0.1.2

Published

A helper library for Apple DAAP protocol

Downloads

11

Readme

node-daap

NPM

node-daap is a Node.js helper library for Apple DAAP protocol. DAAP protocol has been built over HTTP. Apple doesn't provide a proper documentation for his protocol, that's why it is difficult to get some efficient information about the protocol. Almost all of the work that has been done, has been made by sniffing the network between my computer and official Apple Remote app. I will update the documentation as soon as I have some new information.

The library uses request to handle some interaction between user and iTunes. It has been designed to be as easiest as possible to use !

###Options

  • host : IP address or domain name where iTunes is located ;
  • port : Port which iTunes uses (default : 3689)
  • pairingCode : pairing code used to connect to iTunes the first time. You can get a proper pairing code using this tool : PairingJS. Please send me your question about this tool.

###Implementation

All the methods are built in the same way : they are all asynchronous, and every callbacks are composed with the same parameters. Here is an example :

var daap = require('daap');

daap.serverInfo(function (error, response) {
    // error = null, if everything is fine
    // response = JS object, parsed from web request response
});

Here are the methods which are currently in node-daap.

####serverInfo

  • Description : Provides information about what the server supports or not.
  • Parameters :
    • None

####login

  • Description : Provides session information for the next requests.
  • Parameters :
    • None

####databases

  • Description : Provides list of databases served up by the server.
  • Parameters :
    • sessionId : Session token get from the login request.

####containers

  • Description : Provides list of playlists which are in the user provided database.
  • Parameters :
    • sessionId : Session token get from the login request.
    • databaseId : Database ID get from the databases request.

####items

  • Description : Provides items (songs) that are in the user provided container.
  • Parameters :
    • sessionId : Session token get from the login request.
    • databaseId : Database ID get from the databases request.
    • containerId : Container ID get from the containers request

####play

  • Description : Play the user provided song.
  • Parameters :
    • sessionId : Session token get from the login request.
    • songId : Song ID get from the items request.

####setProperty

  • Description : Set one or many property (such as volume, for example) in iTunes.
  • Parameters :
    • sessionId : Session token get from the login request.
    • properties : Simple JS object with the properties to set.

####getProperty

  • Description : Get one or many property (such as volume, for example) in iTunes.
  • Parameters :
    • sessionId : Session token get from the login request.
    • properties : Simple JS array with the properties to get.

####artwork

  • Description : Get cover image for a song.
  • Parameters :
    • sessionId : Session token get from the login request.
    • databaseId : Database ID get from the databases request.
    • songId : Song ID get from the items request.

####playPause

  • Description : Play/pause iTunes current song.
  • Parameters :
    • sessionId : Session token get from the login request.

####playStatusUpdate

  • Description : Get information for the current iTunes song.
  • Parameters :
    • sessionId : Session token get from the login request.

###Testing

Every methods have been tested using Nodeunit. You can try yourself and get some examples in the "tests" directory.

koinkoin:/Users/jeffrey/Repositories/node-daap jeffrey$ nodeunit tests/01_music_fetcher.js 
Make sure your environment is properly configured !!
Make sure iTunes is ready.

01_music_fetcher.js
✔ serverInfo
✔ login
✔ databases
✔ containers
✔ items

OK: 16 assertions (937ms)

###Inspiration

This project has found inspiration thanks to great projects and great papers. Here are relevant links to understand how DAAP works :

  • http://daap.sourceforge.net/index.html
  • http://dacp.jsharkey.org/
  • http://blog.mycroes.nl/2008/08/pairing-itunes-remote-app-with-your-own.html
  • http://jinxidoru.blogspot.fr/2009/06/itunes-remote-pairing-code.html
  • https://code.google.com/p/tunesremote-plus/
  • ...

###License

node-daap is freely distributable under the terms of the MIT license.

Copyright (c) 2012 - 2013 Jeffrey Muller <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Bitdeli Badge