Giter VIP home page Giter VIP logo

clj-spotify's Introduction

Build Status Clojars Coverage Status Dependencies Status

clj-spotify

clj-spotify is a client library for accessing the Spotify Web API. clj-spotify aims to be identical to Spotify's Web API when it comes to naming of endpoints, path elements and query parameters therefore the documentation found here is very short. Please read through the Spotify API Endpoint Reference, a one to one mapping from the endpoints to functions in this library should be possible.

##Usage Each function takes a map m of parameters and a sometimes optional oauth token t. Function names are the same as the names found in Spotify's API Endpoint Reference. A function call to retrieve a track from Spotify then has the function signature (get-a-track m t) and a function call to get an album's tracks has the function signature (get-an-albums-tracks m t) and so on.

###map m The map m holds both path elements and query parameters. Key names and value types in m are the same as those found in Spotify's API Endpoint Reference for path elements and query parameters. Integer values such as :limit and :offset can be specified either as integers or strings in m.

###oauth token t For a simple method to deal with authentication through the Client Credentials Flow see the spotify-oauth-token variable in core_test-clj. If you need oauth2 authentication through the Authorization Code Flow see this blog post on how to roll your own: OAuth2 is easy - illustrated in 50 lines of Clojure.

###Return values clj-spotify returns the data received from the Spotify Web API unaltered but the response will be converted from json to a Clojure map.

###Error handling Error messages received from Spotify are returned unaltered as received from the servers. If an API call would result in an exception in clj-spotify this will be returned on the same format as Spotify's error messages but with the :status key set to Exceptionand the result of calling (.getMessage e) on the Exception e associated with the :message key.

##Additional documentation Each function has a basic doc string but if the usage still is unclear please consult Spotify's API Endpoint Reference.

License

The MIT License (MIT)

Copyright (c) 2015 Karl Blomström

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

clj-spotify's People

Contributors

blmstrm avatar blx avatar vjo avatar

Watchers

 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.