Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/breadadams/bit_js
πΈπΆπ©βπ€ Javascript library for the Bands in Town API
https://github.com/breadadams/bit_js
es6-javascript javascript js-library
Last synced: 4 days ago
JSON representation
πΈπΆπ©βπ€ Javascript library for the Bands in Town API
- Host: GitHub
- URL: https://github.com/breadadams/bit_js
- Owner: breadadams
- Created: 2017-08-04T13:10:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-20T23:01:25.000Z (about 5 years ago)
- Last Synced: 2024-04-25T21:43:59.246Z (7 months ago)
- Topics: es6-javascript, javascript, js-library
- Language: JavaScript
- Homepage: https://breadadams.github.io/bit_js/
- Size: 229 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bit_js
[![npm version](https://badge.fury.io/js/bit_js.svg)](https://badge.fury.io/js/bit_js)
[![Build Status](https://travis-ci.org/breadadams/bit_js.svg?branch=master)](https://travis-ci.org/breadadams/bit_js)A small javascript library to retrieve data from the [Bands in Town API](http://www.bandsintown.com/api/overview).
###### Table of contents
1. [Installation](#installation)
2. [Usage](#usage)
1. [ES5](#es5)
2. [ES6](#es6)
3. [Parameters](#parameters)
3. [Terms & Conditions](#tc)## Installation
_(Install and save to dependencies)_
#### NPM
`npm i bit_js --save`#### Yarn
`yarn add bit_js`## Usage
##### _ES5_
```
var bit_js = require('bit_js');var options = {
'artist': 'skrillex',
'app_id': 'my_app_id',
};var optionsEvents = {
'artist': 'skrillex',
'app_id': 'my_app_id',
'daterange': '2017-09-20',
}var callback = function(data) {
console.log(data)
}bit_js.bitGetArtist(options, callback);
bit_js.bitGetArtistEvents(optionsEvents, callback);
```##### _ES6_
```
import {
bitGetArtist,
bitGetArtistEvents
} from 'bit_js'let options = {
'artist': 'skrillex',
'app_id': 'my_app_id',
}let optionsEvents = {
...options,
'daterange': {
'from': '2017-08-31',
'to': '2017-10-05',
}
}bitGetArtist(options, data => console.log(data))
bitGetArtistEvents(optionsEvents, data => console.log(data))
```### Parameters
* **options** `object`:
- **artist** `string`: Name of the artist. For example `Britney%20Spears`.
- **app_id** `string`:
ID of the app using the API. This can be anything.- **daterange** `string|object`:
Can be a single date, or an object (`{'from':'','to':''}`). Date should be in _"BiT format"_, `YYYY-MM-DD`.* **callback(data)** `function`: Callback function that returns data if call is successful.
## T&C
For usage terms & conditions see the [BiT API Terms](http://corp.bandsintown.com/api-terms/).
Note: This project is **not** _affiliated with_ or _maintained by_ [Bands in Town](https://bandsintown.com/).