<commit_before># iTunes API!!

iTunes API is a simple REST server allowing you to query/control a local running
iTunes instance. Once you have a way to make RESTful API calls to control iTunes,
you can integrate its control into any of your own software.

This is especially convenient for integrating into any sort of Home Automationyou might have.

Last confirmed working version of iTunes: `12.2.1`.


## Features

* play/stop/pause/playpause/next/previous control over what's playing.
* query to return what's currently playing.
* fetch the art of the currently playing song.
* set a specific playlist to play, by name.
* query to return a list of available AirPlay endpoints.
* set an AirPlay endpoint to be active. (This can be multiple, since iTunes
  supports it).

## Setup

    npm install
    npm run start

## Docs

This is a quick overview of the service. Read [app.js](app.js) if you need more
info.

### Resources

Here's a list of resources that may be returned in a response.

#### NowPlaying Resource

The NowPlaying resource returns all the information about if iTunes is playing
and what is playing.

```json
{
  "player_state": "playing",
  "id": "AC4FFD2271422B47",
  "name": "Forever",
  "artist": "HAIM",
  "album": "Days Are Gone (2013)"
}
```

#### AirPlayDevice Resource

The AirPlayDevice resource returns all the information about an available<commit_msg>specify port stuff<commit_after># iTunes API!!

iTunes API is a simple REST server allowing you to query/control a local running
iTunes instance. Once you have a way to make RESTful API calls to control iTunes,
you can integrate its control into any of your own software.

This is especially convenient for integrating into any sort of Home Automationyou might have.

Last confirmed working version of iTunes: `12.2.1`.


## Features

* play/stop/pause/playpause/next/previous control over what's playing.
* query to return what's currently playing.
* fetch the art of the currently playing song.
* set a specific playlist to play, by name.
* query to return a list of available AirPlay endpoints.
* set an AirPlay endpoint to be active. (This can be multiple, since iTunes
  supports it).

## Setup

    npm install
    npm run start

iTunes API will run on port `8181` by default. Use the `PORT` environment
variable to use your own port.

## Docs

This is a quick overview of the service. Read [app.js](app.js) if you need more
info.

### Resources

Here's a list of resources that may be returned in a response.

#### NowPlaying Resource

The NowPlaying resource returns all the information about if iTunes is playing
and what is playing.

```json
{
  "player_state": "playing",
  "id": "AC4FFD2271422B47",
  "name": "Forever",
  "artist": "HAIM",
  "album": "Days Are Gone (2013)"
}
```

#### AirPlayDevice Resource

The AirPlayDevice resource returns all the information about an available
{'fraction_non_alphanumeric': 0.07711010767627649, 'fraction_numerical': 0.013893713094824591, 'mean_word_length': 4.079365079365079, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128454', 'n_tokens_mistral': 867, 'n_tokens_neox': 794, 'n_words': 410}