GithubHelp home page GithubHelp logo

rob121 / airfoil-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jnewland/airfoil-api

0.0 2.0 0.0 29 KB

Wrap AirFoil's Applescript interface with a JSON API.

License: MIT License

JavaScript 80.76% AppleScript 7.30% Shell 11.94%

airfoil-api's Introduction

Airfoil API

Wrap Airfoil's Applescript interface with a JSON API.

Usage

$ curl http://localhost:8080/speakers
[{"connected":"false","volume":0.75,"name":"Computer","id":"com.rogueamoeba.airfoil.LocalSpeaker"},{"connected":"false","volume":0.9375,"name":"stream","id":"685B35A4C6BC@stream"},{"connected":"true","volume":0.5,"name":"loft-bathroom","id":"F0D1A90B2769@loft-bathroom"},{"connected":"false","volume":0.75,"name":"magnavox","id":"F0D1A9083B63@magnavox"},{"connected":"false","volume":0.49470898509,"name":"Bedroom ","id":"68D93C804DEA@Bedroom "},{"connected":"false","volume":0.679894208908,"name":"loft","id":"B034953D7649@loft"}]
$ curl -X POST http://localhost:8080/speakers/F0D1A90B2769@loft-bathroom/connect
{"id":"F0D1A90B2769@loft-bathroom","connected":"true"}
$ curl -X POST http://localhost:8080/speakers/F0D1A90B2769@loft-bathroom/disconnect
{"id":"F0D1A90B2769@loft-bathroom","connected":"false"}
$ curl -X POST --data '0.75' http://localhost:8080/speakers/F0D1A90B2769@loft-bathroom/volume
{"id":"F0D1A90B2769@loft-bathroom","volume":0.75}
$ curl -X POST --data '0.76' http://localhost:8080/speakers/F0D1A90B2769@loft-bathroom/volume
{"id":"F0D1A90B2769@loft-bathroom","volume":0.759999990463}

Setup

  script/bootstrap

Running It

  script/server

airfoil-api will run on port 8080 by default. Use the PORT environment variable to use your own port.

Forever

airfoil-api has support for Forever. It uses launchd on OS X to kick it off so that it starts on boot.

Development

You can simply run it by calling script/server. This will run it in development mode with logging to standard out.

Install as Service on OS X

  script/install

Contributions

  • fork
  • create a feature branch
  • open a Pull Request

airfoil-api's People

Contributors

jnewland avatar rob121 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.