-
-
02 Sep 2011 11:48:17 UTC
- Distribution: Net-COLOURlovers
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (514 / 0 / 0)
- Kwalitee
Bus factor: 0- 40.09% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (10.71KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Alan Haggai Alavi
NAME
Net::COLOURlovers - Interface to COLOURlovers.com's API
VERSION
version 0.01
SYNOPSIS
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.
METHOD FORMAT
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 parametreSCALAR
- accepts/returns aSCALAR
HASHREF
- accepts/returns aHASH
ARRAYREF
ofHASHREF
s - accepts/returns anARRAY
reference which hasHASH
references as its elements
ATTRIBUTES
new
Constructs and returns a Net::COLOURlovers object.
METHODS
color
Input:
SCALAR
'color_name'
A 6-character hexadecimal value like
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
andcolors_top
Input:
HASHREF
(optional)lover
hueRange
briRange
keywords
keywordExact
orderCol
sortBy
numResults
resultOffset
Output:
ARRAYREF
ofHASHREF
sFormat same as that for "color".
color_random
Input:
UNDEF
Output:
HASHREF
Format same as that for "color".
lover
Input:
SCALAR
'lover_name'
A valid COLOURlovers.com username.
Output:
HASHREF
userName
dateRegistered
dateLastActive
rating
location
numColors
numPalettes
numCommentsMade
numCommentsOnProfile
comments
url
apiUrl
lovers
,lovers_new
andlovers_top
Input:
HASHREF
(optional)orderCol
sortBy
numResults
resultOffset
Output:
ARRAYREF
ofHASHREF
sFormat same as that for "lover".
palette
Input:
SCALAR
'palette_id'
A valid palette ID like
113451
.
Output:
HASHREF
id
title
userName
numViews
numVotes
numComments
numHearts
rank
dateCreated
colors
description
url
imageUrl
badgeUrl
apiUrl
palettes
,palettes_new
andpalettes_top
Input:
HASHREF
(optional)lover
hueOption
hex
keywords
keywordExact
orderCol
sortBy
numResults
resultOffset
showPaletteWidths
Output:
ARRAYREF
ofHASHREF
sFormat same as that for "palette".
palette_random
Input:
UNDEF
Output:
HASHREF
Format same as that for "palette".
pattern
Input:
SCALAR
'pattern_id'
A valid pattern ID like
1451
.
Output:
ARRAYREF
ofHASHREF
sid
title
userName
numViews
numVotes
numComments
numHearts
rank
dateCreated
colors
description
url
imageUrl
badgeUrl
apiUrl
patterns
,patterns_new
andpatterns_top
Input:
HASHREF
(optional)lover
hueOption
hex
keywords
keywordExact
orderCol
sortBy
numResults
resultOffset
Output:
ARRAYREF
ofHASHREF
sFormat same as that for "pattern".
pattern_random
Input:
UNDEF
Output:
HASHREF
Format same as that for "pattern".
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.
SEE ALSO
COLOURLovers API Documentation
ATTRIBUTION CREDIT
AUTHOR
Alan Haggai Alavi <alanhaggai@alanhaggai.org>
COPYRIGHT AND LICENSE
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.
Module Install Instructions
To install Net::COLOURlovers, copy and paste the appropriate command in to your terminal.
cpanm Net::COLOURlovers
perl -MCPAN -e shell install Net::COLOURlovers
For more information on module installation, please visit the detailed CPAN module installation guide.