Net::COLOURlovers - Interface to COLOURlovers.com's API
version 0.01
use Net::COLOURlovers; my $cl = Net::COLOURlovers->new; my $pattern = $cl->pattern_random; my @colors = $cl->colors_top( { 'numResults' => 5 } );
A sample page built using this API can be found at: http://bit.ly/qtIepU.
Each method listed below has its input and output parametres specified in sections titled Input and Output. These sections are followed by the parametre type:
UNDEF - accepts no parametre
UNDEF
SCALAR - accepts/returns a SCALAR
SCALAR
HASHREF - accepts/returns a HASH
HASHREF
HASH
ARRAYREF of HASHREFs - accepts/returns an ARRAY reference which has HASH references as its elements
ARRAYREF
ARRAY
new
Constructs and returns a Net::COLOURlovers object.
color
Input: SCALAR
'color_name'
A 6-character hexadecimal value like 6B4106.
6B4106
Output: HASHREF
id
title
userName
numViews
numVotes
numComments
numHearts
rank
dateCreated
hex
rgb
red
green
blue
hsv
hue
saturation
value
description
url
imageUrl
badgeUrl
apiUrl
colors
colors_new
colors_top
Input: HASHREF (optional)
lover
hueRange
briRange
keywords
keywordExact
orderCol
sortBy
numResults
resultOffset
Output: ARRAYREF of HASHREFs
Format same as that for "color".
color_random
Input: UNDEF
'lover_name'
A valid COLOURlovers.com username.
dateRegistered
dateLastActive
rating
location
numColors
numPalettes
numCommentsMade
numCommentsOnProfile
comments
lovers
lovers_new
lovers_top
Format same as that for "lover".
palette
'palette_id'
A valid palette ID like 113451.
113451
palettes
palettes_new
palettes_top
hueOption
showPaletteWidths
Format same as that for "palette".
palette_random
pattern
'pattern_id'
A valid pattern ID like 1451.
1451
patterns
patterns_new
patterns_top
Format same as that for "pattern".
pattern_random
stats_colors
Returns total number of colors.
stats_lovers
Returns total number of lovers.
stats_palettes
Returns total number of palettes.
stats_patterns
Returns total number of patterns.
COLOURLovers API Documentation
COLOURlovers.com
Alan Haggai Alavi <alanhaggai@alanhaggai.org>
This software is copyright (c) 2011 by Alan Haggai Alavi.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::COLOURlovers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::COLOURlovers
CPAN shell
perl -MCPAN -e shell install Net::COLOURlovers
For more information on module installation, please visit the detailed CPAN module installation guide.