Permalink
Browse files

Updated README

  • Loading branch information...
1 parent fb1b1e8 commit 14034c6a9413ffc209eb086bd6c5ebc27bbd66b4 @blanc0 committed May 27, 2012
Showing with 54 additions and 36 deletions.
  1. +54 −36 README.md
View
@@ -17,51 +17,69 @@ Example Usage:
// Search Example.
- require_once('/path/to/cecilia/cecilia.bootstrap.php');
- use \cecilia\core\Cecilia;
+ require_once('/path/to/cecilia/cecilia.phar');
- $cecilia = new Cecilia();
-
- $albums = $cecilia->search('doom',array('type'=>'album');
-
- //or, if you are using php5.4
$albums = (new Cecilia)->search('doom',['type'=>'album']);
-
+ //Play Example.
$play = (new Cecilia)->play('spotify:artist:23423423423',['theme'=>'light','size'=>640]);
- // returns an iframe with the
-
-
-Cecilia also comes with a ready to use api layer that speaks json. This only requires one minor update to your web server configuration.
+
- curl -0 http://yoursite.com/cecilia/search/doom?&type=artist&page=4&
-
- curl -0 http://yoursite.com/cecilia/lookup/doom
-
- curl -0 http://yoursite.com/cecilia/play/spotify:track:unr4nr348n
-
-
-nginx:
-
- server{
-
- ...
-
- rewrite ^/cecilia(.*)$ /path/to/cecilia/cecilia.php?$1 break;
-
- ...
- }
-
-
-
-Apache:
-
- RewriteRule ^cecilia/(.*)$ /path/to/cecilia/cecilia.php/$1 [L]
-
+Responses
+ - Cecilia Adds Additional Response Information.
+ - Below is an example of a Cecilia Response:
+
+ $albums = (new Cecilia)->search('doom',['type'=>'album']);
+ var_dump($albums);
+
+ {"success":1,
+ "data":[
+ {
+ "name":"album name",
+ "popularity":0.5,
+ "href":"spotify:album:fjsdjof490jf49",
+ ...
+ },
+ ...
+ ],
+ "pager":{
+ "has_next":true,
+ "has_prev":false,
+ "total_pages":12,
+ ...
+
+ },
+ "message":""
+ }
+
+ - If success is 0, we know something failed and we should get the error in the message field.
+
+ - Cecilia also comes with a ready to use api layer that speaks json. This only requires one minor update to your web server configuration.
+
+ nginx:
+
+ server{
+ ...
+ rewrite ^/cecilia(.*)$ /path/to/cecilia/api.php?$1 break;
+ ...
+ }
+
+ Apache:
+
+ RewriteRule ^cecilia/(.*)$ /path/to/cecilia/api.php/$1 [L]
+
+
+Once Your Configuration is updated and webserver restarted, try calling one of the following URLs:
+
+ curl -0 http://yoursite.com/cecilia/search/doom?type=track&page=4&
+ curl -0 http://yoursite.com/cecilia/lookup/doom?type=artist
+ curl -0 http://yoursite.com/cecilia/play/spotify:track:unr4nr348n?t=white&h=720&w=300
+
+
References

0 comments on commit 14034c6

Please sign in to comment.