forked from jquery/themeroller.jquerymobile.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kuler.php
25 lines (20 loc) · 854 Bytes
/
kuler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
//php script use to query the kuler-api
//using timeSpan constraint on every query to improve performance
//kuler api consists of a few url params:
//search.cfm used to search by tag, title, hex value
//get.cfm gets certain listTypes
//set $kuler_key here as a string or in your .htaccess file with directive SetEnv "kuler-api-key" "key_goes_here"
$kuler_key = $_SERVER["kuler-api-key"];
$post = $_POST;
$query_string = '';
foreach($post as $key => $p) {
$query_string .= '&' . $key . '=' . $p;
}
header("Content-type: text/xml");
if(isset($post['list'])) {
echo( file_get_contents("http://kuler-api.adobe.com/rss/get.cfm?" . $query_string. "&key=" . $kuler_key));
} else if(isset($post['search'])) {
echo( file_get_contents("http://kuler-api.adobe.com/rss/search.cfm?" . $query_string . "&key=" . $kuler_key));
}
?>