/band-camp

Scrape the found, tags, tracks. at the bandcamp.com.

Primary LanguageCoffeeScript

Bandcamp NPM version Build Status Coverage Status

Scrape the search results, tags, and album tracks in the bandcamp.com.

Installation

$ npm install band-camp --save

API

If use the options, it has been also used as an options of the caravan.

bandcamp(tag,options) -> Promise(summaries)

fetch summaries between the options.first to options.last. default 40 alubms(1 and 1).

bandcamp('vgm')
.then((summaries)=>{
  console.log(summaries)
  // [
  //  {
  //    "url": "http://dbsoundworks.bandcamp.com/album/crypt-of-the-//necrodancer-ost",
  //    "thumbnail": "https://f1.bcbits.com/img/a2187335077_11.jpg",
  //    "title": "Crypt of the Necrodancer OST",
  //    "author": "Danny Baranowsky"
  //  },
  //
  //  (... more 39 summaries... (40 album * 1 page - 1))
  // ]
})

.search(words,options) -> Promise(results)

fetch search results between the options.first to option.last.

bandcamp.search('flashygoodness')
.then((results)=>{
  // takes a few minutes...
  
  console.log(results)
  // [
  //   {
  //     "type": "ARTIST",
  //     "url": "http://store.flashygoodness.com",
  //     "heading": "flashygoodness",
  //     "genre": "Electronic",
  //     "tags": [
  //       "instrumental",
  //       "flashygoodness",
  //       "soundtrack",
  //       "Electronic"
  //     ]
  //   },
  //   {
  //     "type": "ALBUM",
  //     "url": "http://store.flashygoodness.com/album/tower-of-heaven-original-soundtrack",
  //     "heading": "Tower of Heaven (Original Soundtrack)",
  //     "subhead": "by flashygoodness",
  //     "released": "2010-07-24",
  //     "tags": [
  //       "vgm",
  //       "askiisoft",
  //       "electronic",
  //       "United States",
  //       "instrumental",
  //       "game",
  //       "soundtrack",
  //       "chiptune",
  //       "flashygoodness",
  //       "video game music",
  //       "Electronic"
  //     ]
  //   },
  //   (more results...)
  // ]
})

.albums(summariesOrUrls,options) -> Promise(albums)

fetch album pages.

bandcamp.albums([
  'http://dbsoundworks.bandcamp.com/album/crypt-of-the-necrodancer-ost',
])
.then((albums)=>{
  console.log(albums)
  // [
  //   {
  //     "url": "http://dbsoundworks.bandcamp.com/album/crypt-of-the-necrodancer-ost",
  //     "title": "Crypt of the Necrodancer OST",
  //     "author": "Danny Baranowsky",
  //     "license": "copyright",
  //     "artwork": "http://f1.bcbits.com/img/a2187335077_10.jpg",
  //     "thumbnail": "http://f1.bcbits.com/img/a2187335077_16.jpg",
  //     "fanCount": 630,
  //     "tracks": [
  //       {
  //         "title": "Tombtorial (Tutorial)",
  //         "url": "http://popplers5.bandcamp.com/download/track?enc=mp3-128&fsig=663eefe823139816899fcf0746ff29c7&id=415514545&stream=1&ts=1439820305.0",
  //         "time": "03:18"
  //       },
  //       ...
  //     ]
  //   }
  // ]
})

.tags() -> Promise({tags,locations})

fetch all tags.

bandcamp.tags()
.then((result)=>{
  console.log(result.tags)
  // ["electronic","rock","experimental","alternative",...]

  console.log(result.locations)
  // ["united-kingdom","usa","california","canada",...]
})

License

MIT