项目作者: JohnnyTheTank

项目描述 :
AngularJS factory for Bandsintown JSON REST API requests
高级语言: JavaScript
项目地址: git://github.com/JohnnyTheTank/angular-bandsintown-api-factory.git
创建时间: 2015-12-29T23:20:10Z
项目社区:https://github.com/JohnnyTheTank/angular-bandsintown-api-factory

开源协议:MIT License

下载


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

npm version
Bower version

Author: Jonathan Hornung (JohnnyTheTank)

Usage

  1. Install via either bower, npm 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
  2. Include dependencies in your HTML.

    1. When using bower:
      1. <script src="bower_components/angular-bandsintown-api-factory/dist/angular-bandsintown-api-factory.min.js"></script>
    2. When using npm:
      1. <script src="node_modules/angular-bandsintown-api-factory/dist/angular-bandsintown-api-factory.min.js"></script>
    3. when using downloaded files
      1. <script src="angular-bandsintown-api-factory.min.js"></script>
  3. Add jtt_bandsintown to your application’s module dependencies.
  4. Use the factory bandsintownFactory

factory methods

getArtist

Get all parameters here

  1. // all parameters: http://bandsintown.com/api/requests#artists-get
  2. bandsintownFactory.getArtist({
  3. artist:"<ARTIST_NAME>", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
  4. artist_id:"<ARTIST_ID>", // (optional) fallback: mbid_<id> (MusicBrainz ID), fbid_<id> (Facebook Page ID)
  5. app_id:"<YOUR_APP_ID>", //The application ID can be anything, but should be a word that describes your application or company.
  6. }).then(function (_data) {
  7. //on success
  8. }).catch(function (_data) {
  9. //on error
  10. });

getEvents

Get all parameters here

  1. // all parameters: http://bandsintown.com/api/requests#artists-events
  2. bandsintownFactory.getEventsFromArtist({
  3. artist:"<ARTIST_NAME>", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
  4. artist_id:"<ARTIST_ID>", // (optional) fallback: mbid_<id> (MusicBrainz ID), fbid_<id> (Facebook Page ID)
  5. date:"<DATE>", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
  6. app_id:"<YOUR_APP_ID>", //The application ID can be anything, but should be a word that describes your application or company.
  7. }).then(function (_data) {
  8. //on success
  9. }).catch(function (_data) {
  10. //on error
  11. });

Get all parameters here

  1. // all parameters: http://bandsintown.com/api/requests#artists-event-search
  2. bandsintownFactory.getEventsFromArtistByLocation({
  3. artist:"<ARTIST_NAME>", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
  4. artist_id:"<ARTIST_ID>", // (optional) fallback: mbid_<id> (MusicBrainz ID), fbid_<id> (Facebook Page ID)
  5. date:"<DATE>", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
  6. location:"<LOCATION>", // city,state (US or CA) || city,country || lat,lon || ip address
  7. radius:"<RADIUS">, // (optional) (default: 25) in miles. valid values: 0-150
  8. app_id:"<YOUR_APP_ID>", //The application ID can be anything, but should be a word that describes your application or company.
  9. }).then(function (_data) {
  10. //on success
  11. }).catch(function (_data) {
  12. //on error
  13. });

Get all parameters here

  1. // all parameters: http://bandsintown.com/api/requests#artists-recommended-events
  2. bandsintownFactory.getRecommendedEventsFromArtistByLocation({
  3. artist:"<ARTIST_NAME>", // ? and / characters must be double escaped. Artists such as "AC/DC" will end up as "AC%252FDC"
  4. artist_id:"<ARTIST_ID>", // (optional) fallback: mbid_<id> (MusicBrainz ID), fbid_<id> (Facebook Page ID)
  5. date:"<DATE>", // (optional) (default: upcoming) yyyy-mm-dd || yyyy-mm-dd,yyyy-mm-dd (inclusive range) || upcoming || all
  6. location:"<LOCATION>", // city,state (US or CA) || city,country || lat,lon || ip address
  7. radius:"<RADIUS">, // (optional) (default: 25) in miles. valid values: 0-150
  8. only_recs:"<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.
  9. app_id:"<YOUR_APP_ID>", //The application ID can be anything, but should be a word that describes your application or company.
  10. }).then(function (_data) {
  11. //on success
  12. }).catch(function (_data) {
  13. //on error
  14. });

Bandsintown V2 JSON API

Docs: http://bandsintown.com/api/requests

More angular-api-factories

bandsintown - dailymotion - facebook - flickr - footballdata - github - openweathermap - tumblr - vimeo - wikipedia - youtube

License

MIT