Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/johnnythetank/angular-bandsintown-api-factory

AngularJS factory for Bandsintown JSON REST API requests
https://github.com/johnnythetank/angular-bandsintown-api-factory

angular angular-factory angularjs api bandsintown bandsintown-api events factory music

Last synced: 30 days ago
JSON representation

AngularJS factory for Bandsintown JSON REST API requests

Awesome Lists containing this project

README

        

**angular-bandsintown-api-factory** is an angularjs module with a bandsintown v2 api factory.

[![npm version](https://badge.fury.io/js/angular-bandsintown-api-factory.svg)](https://badge.fury.io/js/angular-bandsintown-api-factory)
[![Bower version](https://badge.fury.io/bo/angular-bandsintown-api-factory.svg)](https://badge.fury.io/bo/angular-bandsintown-api-factory)

Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))

## Usage
1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:
1. `bower install --save angular-bandsintown-api-factory`
2. `npm install --save angular-bandsintown-api-factory`
3. download [angular-bandsintown-api-factory.zip](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory/zipball/master)

2. Include dependencies in your HTML.
1. When using bower:
```html

```
2. When using npm:
```html

```
3. when using downloaded files
```html

```
3. Add **`jtt_bandsintown`** to your application's module dependencies.
4. Use the factory `bandsintownFactory`

### factory methods

#### getArtist
Get all parameters [here](http://bandsintown.com/api/requests#artists-get)
```js
// all parameters: http://bandsintown.com/api/requests#artists-get
bandsintownFactory.getArtist({
artist:"", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
artist_id:"", // (optional) fallback: mbid_ (MusicBrainz ID), fbid_ (Facebook Page ID)
app_id:"", //The application ID can be anything, but should be a word that describes your application or company.
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

#### getEvents
Get all parameters [here](http://bandsintown.com/api/requests#artists-events)
```js
// all parameters: http://bandsintown.com/api/requests#artists-events
bandsintownFactory.getEventsFromArtist({
artist:"", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
artist_id:"", // (optional) fallback: mbid_ (MusicBrainz ID), fbid_ (Facebook Page ID)
date:"", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
app_id:"", //The application ID can be anything, but should be a word that describes your application or company.
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

Get all parameters [here](http://bandsintown.com/api/requests#artists-event-search)
```js
// all parameters: http://bandsintown.com/api/requests#artists-event-search
bandsintownFactory.getEventsFromArtistByLocation({
artist:"", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
artist_id:"", // (optional) fallback: mbid_ (MusicBrainz ID), fbid_ (Facebook Page ID)
date:"", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
location:"", // city,state (US or CA) || city,country || lat,lon || ip address
radius:", // (optional) (default: 25) in miles. valid values: 0-150
app_id:"", //The application ID can be anything, but should be a word that describes your application or company.
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

Get all parameters [here](http://bandsintown.com/api/requests#artists-recommended-events)
```js
// all parameters: http://bandsintown.com/api/requests#artists-recommended-events
bandsintownFactory.getRecommendedEventsFromArtistByLocation({
artist:"", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
artist_id:"", // (optional) fallback: mbid_ (MusicBrainz ID), fbid_ (Facebook Page ID)
date:"", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
location:"", // city,state (US or CA) || city,country || lat,lon || ip address
radius:", // (optional) (default: 25) in miles. valid values: 0-150
only_recs:"", // (optional) (default: false) if true, the response will only include matching events for artists similar to the specified artist. if false, the response may also include matching events for the specified artist.
app_id:"", //The application ID can be anything, but should be a word that describes your application or company.
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

## Bandsintown V2 JSON API
Docs: http://bandsintown.com/api/requests

## More angular-api-factories
**bandsintown** - [dailymotion](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory) - [facebook](https://github.com/JohnnyTheTank/angular-facebook-api-factory) - [flickr](https://github.com/JohnnyTheTank/angular-flickr-api-factory) - [footballdata](https://github.com/JohnnyTheTank/angular-footballdata-api-factory) - [github](https://github.com/JohnnyTheTank/angular-github-api-factory) - [openweathermap](https://github.com/JohnnyTheTank/angular-openweathermap-api-factory) - [tumblr](https://github.com/JohnnyTheTank/angular-tumblr-api-factory) - [vimeo](https://github.com/JohnnyTheTank/angular-vimeo-api-factory) - [wikipedia](https://github.com/JohnnyTheTank/angular-wikipedia-api-factory) - [youtube](https://github.com/JohnnyTheTank/angular-youtube-api-factory)

## License

MIT