-
Notifications
You must be signed in to change notification settings - Fork 3
Methods Lovers
brianhaveri edited this page Sep 14, 2010
·
6 revisions
Method | Description | Parameter | Returns |
---|---|---|---|
lover |
Get a single lover | string $username OR array $query
|
array |
lovers |
Get multiple lovers | array $query
|
array |
lovers_top |
Get top lovers | array $query
|
array |
lovers_new |
Get new lovers | array $query
|
array |
For lover methods, the parameter $query
array can include the following keys:
format
jsonCallback
-
comments
– Only available forlover()
-
lover
– Not available forlover()
-
hueOption
– Not available forlover()
-
hex
– Not available forlover()
-
keywords
– Not available forlover()
-
keywordExact
– Not available forlover()
-
orderCol
– Not available forlover()
-
sortBy
– Not available forlover()
-
numResults
– Not available forlover()
-
resultOffset
– Not available forlover()
More information on $query
keys and return values at the ColourLOVERS.com API page
require_once('ColourLovers.php'); $c = new ColourLovers; $results = $c->lover('darkmotion'); print_r($results); /* Array ( [@attributes] => Array ( [numResults] => 1 [totalResults] => 1 ) [lover] => Array ( [userName] => darkmotion [dateRegistered] => 2006-01-28 1:27:13 [dateLastActive] => 2010-02-06 1:43:28 [rating] => 2401 [location] => Australia [numColors] => 70 [numPalettes] => 36 [numPatterns] => 1 [numCommentsMade] => 21 [numLovers] => 33 [numCommentsOnProfile] => 21 [url] => http://www.colourlovers.com/lover/darkmotion [apiUrl] => http://www.colourlovers.com/api/lover/darkmotion ) ) */
$c = new ColourLovers; $results = $c->lovers_top(array('numResults'=>5)); print_r($results); /* Array ( [@attributes] => Array ( [numResults] => 5 [totalResults] => 292835 ) [lover] => Array ( [0] => Array ( [userName] => retsof [dateRegistered] => 2005-07-29 6:48:45 [dateLastActive] => 2010-02-15 7:35:59 [rating] => 1081491 [location] => Austin Texas [numColors] => 17,690 [numPalettes] => 5,635 [numPatterns] => 6,468 [numCommentsMade] => 53,364 [numLovers] => 1,610 [numCommentsOnProfile] => 6,016 [url] => http://www.colourlovers.com/lover/retsof [apiUrl] => http://www.colourlovers.com/api/lover/retsof ) [1] => Array ( [userName] => electrikmonk [dateRegistered] => 2005-08-07 6:45:47 [dateLastActive] => 2010-01-31 18:51:43 [rating] => 671891 [location] => #FF0000stick, LA, US [numColors] => 3,788 [numPalettes] => 2,837 [numPatterns] => 36 [numCommentsMade] => 7,321 [numLovers] => 1,007 [numCommentsOnProfile] => 878 [url] => http://www.colourlovers.com/lover/electrikmonk [apiUrl] => http://www.colourlovers.com/api/lover/electrikmonk ) [2] => Array ( [userName] => manekineko [dateRegistered] => 2007-06-18 15:29:28 [dateLastActive] => 2010-02-02 1:28:03 [rating] => 655516 [location] => Top Left Corner of USA [numColors] => 36,427 [numPalettes] => 11,251 [numPatterns] => 349 [numCommentsMade] => 12,543 [numLovers] => 1,779 [numCommentsOnProfile] => 1,449 [url] => http://www.colourlovers.com/lover/manekineko [apiUrl] => http://www.colourlovers.com/api/lover/manekineko ) [3] => Array ( [userName] => realitybites [dateRegistered] => 2006-07-17 3:28:54 [dateLastActive] => 2010-02-12 9:41:38 [rating] => 649412 [location] => Flagstaff, Arizona [numColors] => 3,607 [numPalettes] => 1,207 [numPatterns] => 621 [numCommentsMade] => 1,959 [numLovers] => 445 [numCommentsOnProfile] => 314 [url] => http://www.colourlovers.com/lover/realitybites [apiUrl] => http://www.colourlovers.com/api/lover/realitybites ) [4] => Array ( [userName] => tvr [dateRegistered] => 2008-03-13 8:12:02 [dateLastActive] => 2010-02-15 8:36:38 [rating] => 629730 [location] => [numColors] => 6,715 [numPalettes] => 3,240 [numPatterns] => 983 [numCommentsMade] => 38,029 [numLovers] => 1,131 [numCommentsOnProfile] => 5,642 [url] => http://www.colourlovers.com/lover/tvr [apiUrl] => http://www.colourlovers.com/api/lover/tvr ) ) ) */