This is a Common Lisp library, cl-en, for accessing the echonest <http://the.echonest.com/> developer API. It is current as of mid April 2008. At that time there were only two API calls.
== Copyright & Default License
The copyright on CL-EN is held by Ben Hyde <bhyde@pobox.com>, who grant you a license
under Apache License, Version 2.0; you may not use this work except in compliance with
the license. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
This work depends upon other works and it is certain that their licenses vary.
Sends, via HTTP, the mp3 file denoted to Echonest for analysis. The response object describes their response. Errors, at the TCP/HTTP level, maybe raised. Their response may contain errors. A job identifier is returned in the response object and is used to poll for job status or results. You will need to persist that id until you have retieved the job results.
The library has direct dependencies on CXML-RNG, and CL-PPCRE, and indirect dependencies on many other things.
== Implementation
The XML responses are run thru progressively thru CXML, CXML-RNG, and en::*the-sax-handler*, an instance of en::sax-handler. The relax ng schema defined in rng/analysis.rng is used to validate, via cxml-rng:parse-compact, so the methods of en::sax-handler needn't be particularly paranoid. Those methods assemble the objects and are guided by simple tables build by the macros seen in data-model.
I noticed as building this a few random things about the echonext api implementation. The unusual http error code 597 is returned in some scenarios for malformed requests, such as unknown method. They don't appear to support HTTP chunking. The upload method has parameters in both the URL and in the POST body.
The xml to object mapping could be more elegant.
I am not using this library, writting it was a lark. Just ask and I'll grant you permission to commit changes.
== Example
In the following example the "..." are places where some text has been
removed. So you can repeat this example the mp3 was pulled from PodSafeAudio.com (e.g. here[1]) which grants a generous license.