Skip to content

Commit

Permalink
moves boring stuff to bottom of readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Jun 15, 2011
1 parent f3aed54 commit f8f8ac4
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,46 +43,6 @@ Cancels authentication.

Next requests will not be authenticated

## The Response

The API tries to return to you the information you typically need, and spare you information such as status codes, messages, etc, if
the response was successful. Below is an example of a fully rendered response.

Array
(
[status] => Array
(
[version] => 4.2
[code] => 0
[message] => Success
)

[artists] => Array
(
[0] => Array
(
[name] => Radiohead
[id] => ARH6W4X1187B99274F
)

)

)

Often times, the status information is not needed. However, if you would like the API to return the full response (this is often
needed when dealing with pagers, as the "total" and "start" parameters are passed outside of the "artists" array, for example),
set the *raw* option to `true` for your API.

// pass options to getter
$response = $echonest->getArtistApi(array('raw' => true))->search(array('name' => 'Radiohead'));

// set options manually
$artistApi = $echonest->getArtistApi();
$artistApi->setOption('raw', true);
$response = $artistApi->search(array('name' => 'Radiohead'));

If you think this is dumb, let me know and I will consider making `raw` the default.

## Artists

For searching artists, getting artist information and music.
Expand Down Expand Up @@ -157,6 +117,47 @@ Wraps [EchoNest Track API](http://developer.echonest.com/docs/v4/track.html).

Please view the documentation in this project or on http://echonest.com to see all the options available

## The Response

The API tries to return to you the information you typically need, and spare you information such as status codes, messages, etc, if
the response was successful. Below is an example of a fully rendered response.

Array
(
[status] => Array
(
[version] => 4.2
[code] => 0
[message] => Success
)

[artists] => Array
(
[0] => Array
(
[name] => Radiohead
[id] => ARH6W4X1187B99274F
)

)

)

Often times, the status information is not needed. However, if you would like the API to return the full response (this is often
needed when dealing with pagers, as the "total" and "start" parameters are passed outside of the "artists" array, for example),
set the *raw* option to `true` for your API.

// pass options to getter
$response = $echonest->getArtistApi(array('raw' => true))->search(array('name' => 'Radiohead'));

// set options manually
$artistApi = $echonest->getArtistApi();
$artistApi->setOption('raw', true);
$response = $artistApi->search(array('name' => 'Radiohead'));

If you think this is dumb, let me know and I will consider making `raw` the default.


# To Do

Better documentation and test coverage will be coming soon

0 comments on commit f8f8ac4

Please sign in to comment.