Download the PHP package ericlagarda/beatportapi without Composer
On this page you can find all versions of the php package ericlagarda/beatportapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ericlagarda/beatportapi
More information about ericlagarda/beatportapi
Files in ericlagarda/beatportapi
Package beatportapi
Short Description Beatport Api Class
License WTFPL
Homepage https://github.com/ericlagarda/beatportapi
Informations about the package beatportapi
Beatport API PHP Class
A simple PHP class to query the Beatport API via Oauth, server side.
The use case is for a server to server context - for example I used it to build a simple Beatport RSS feed for my label. The library handles the three legged Oauth1a flow, submitting what would be the client side login/confirmation process via the server. Beatport does advertise a simpler Direct Access Token, but you need additional permissions, and this library works without that.
The class essentially just returns an array which you can then manipulate as you please.
This is originally based on the following people's work:
- Beatport API Json Feed by Federico Giust (I forked this repo as a starting point)
- Beatport OAuth Connect w/ PECL by Tim Brandwijk (Federico Giust's script was based on this one)
- Beatport OAuth Connect w/ PEAR by Christian Kolloch (Also based on Tim Brandwijk's script)
Aims
- Login and query the Beatport API
- Abstract away the OAuth pain
- Send back a simple array with the query results
Requirements
- PHP 5.5+
- Beatport API Key and login details (You'll need to request those from Beatport)
- Guzzle 6 (via composer)
Install
Usage
You can check the Beatport API documentation for which queries you can make and which parameters are required, although they are currently untested much beyond the above example, and not everything is documented, so your mileage may vary.
Disclaimer
Totally and utterly alpha, and likely to break at any point. Not guaranteed to work as intended in any way, so use at your own risk.
Todo
- Store the tokens somewhere and re-use until expiry
- Get some sanity into the variable / method names
- Add some proper error catching / messaging
- Test and document other query types.
Maintained
Contribute
Would be cool to improve this, so feel free to submit bug reports, suggestions and pull requests. Can't guarantee I've got enough time to do very much though! Alternatively just fork it and make your own thing.
License
WFTPL, insofar as those other guys are cool with that.
Music
Outside of geekdom, I'm a DJ, producer and label manager, go check me out: