GithubHelp home page GithubHelp logo

spinitron-spinpapi-js's Introduction

spinpapi nodejs client

javascript client for spinitron's SpinPapi API v2 https://spinitron.com/user-guide/pdf/SpinPapi-v2.pdf

Usage

var spinitron = require('spinitron-spinpapi');

spinitron = new spinitron({
                    station: 'ksdt',  /* optional */
                    userid: 'youruserid',
                    secret: 'yoursecret'
            });

spinitron.getRegularShowsInfo({ When: 'now' }, function (error, response) {
    console.log(response.results[0].ShowName); // => RTFM: CC Music
});

Sample response:

> { request:
   { When: 'now',
     method: 'getRegularShowsInfo',
     papiuser: 'xxxxxxe687xxxxxx',
     papiversion: '2',
     station: 'ksdt',
     timestamp: '2015-12-18T18:48:07Z',
     signature: 'VUtBPMZra3Z4T7FeTByP8qsmrNvB7isb4QLdFnQf6oA=' },
  success: true,
  results:
   [ { ShowID: 529,
       ShowUsers: [Object],
       ShowName: 'bread&butter',
       Weekdays: [Object],
       OnairTime: '10:00:00',
       OffairTime: '11:00:00',
       Scheduled: true,
       ShowCategory: 'Music',
       ShowUrl: '',
       ShowImgL: [Object],
       ShowDescription: 'Getcha weekly Bread & Butter with ya host DJ toast. This show is great dont listen to what those other bagels say they just jealous' } ] }

Methods

For an indepth description of the required options and the results, please visit the official API docs here: https://spinitron.com/user-guide/pdf/SpinPapi-v2.pdf

spinitron.getSong(options, callback);

spinitron.getSongs(options, callback);

spinitron.getCurrentPlaylist(options, callback);

spinitron.getPlaylistInfo(options, callback);

spinitron.getPlaylistsInfo(options, callback);

spinitron.getShowInfo(options, callback);

spinitron.getRegularShowsInfo(options, callback);

spinitron.generateRequest(method, options);

This function will return the request URL for the given method and options. For example, spinitron.generateRequest('getSong', {SongId: 3}); will return the SpinPapi API Url for this request.

Optional Parameters

When a method has optional parameters, you may choose to omit the options parameter, like so spinitron.getSong(callback)

Testing, Contributing

mocha to test. Pull requests welcome.

spinitron-spinpapi-js's People

Contributors

m4chinations avatar

Watchers

James Cloos avatar Joshua Hassler avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.