# wikifonia

> A scraper for the Wikifonia sheet website

Latest version **0.1.1** (published 2013-10-02) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install wikifonia
pnpm add wikifonia
yarn add wikifonia
bun add wikifonia
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-10-02 |
| First published | 2013-05-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jakob Miland |
| Maintainers | saebekassebil |
| Keywords | wikifonia, musicjson, musicxml, sheet |

## Links

- npm: https://www.npmjs.com/package/wikifonia
- Repository: https://github.com/saebekassebil/wikifonia
- Issues: https://github.com/saebekassebil/wikifonia/issues
- npm.io page: https://npm.io/package/wikifonia

## Dependencies (3)

- [q](https://npm.io/package/q.md) ~0.9.3
- [cheerio](https://npm.io/package/cheerio.md) ~0.11.0
- [request](https://npm.io/package/request.md) ~2.21.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2013-10-02
- 0.0.1 — 2013-05-11

## README

# Wikifonia scraper

Simple scraper for the wonderful [Wikifonia](http://www.wikifonia.org).
This scrapes the search pages, and returns a list of `track` objects, which
contains information such as, title, artist(s), performer(s), lyricist(s) and
Wikifonia ID.

## Install

    $ npm install wikifonia

## Usage

The *one* method in this library, is the `search` function:

### wikifonia.search({ artist, title, page }) -> { tracks, pages }

Takes an object, with one or more of above parameters.

 - *artist*: The name of the sheet author
 - *title*: The title of the sheet
 - *page*: The first page of the search results is 0, the second is 1, etc.

Returns a `Promise` of an object with two properties:

    {
      tracks: [], // Array of tracks
      pages: 1    // Number of pages (zero-indexed)
    }

Each `track` has the following properties:

    track = {
      title:        String,
      artist:       String | Array(String),
      performer:    String | Array(String),
      lyricist:     String | Array(String),
      id:           String
    }

The syntax looks like this:

    var wikifonia = require('wikifonia');

    wikifonia.search({ artist: 'Charlie Parker' })
    .then(function(res) {
      var tracks = res.tracks;
      var pages = res.pages;

      // Now do something nice with all your Charlie Parker tracks!
    });

    wikifonia.search({ title: 'Scrapple from the Apple' })
    .then(function(res) {
      var tracks = res.tracks;
      var pages = res.pages;

      // Do something with you Scrapple from the Apple track(s)
    });

### wikifonia.stream(track | trackID) -> WritableStream

Oh yea, there's one more convenience method to get a stream from which you
can download the compressed MusicXML file (.mxl) directly

    wikifonia.search({ title: 'Jump Monk' }).then(function(res) {
      // Take the first track
      var track = res.tracks[0];

      // Stream it to a local file
      wikifonia.stream(track).pipe(fs.createWriteStream('jump_monk.mxl'));
    });

The method takes either a track (as returned from the `search` method) or a
track ID (which is also part of the `track` object returned from the `search` method)

---
_Source: https://npm.io/package/wikifonia · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
