Show README syntax highlighted
GROU.PS Web 2.0 PHP API
============================
http://grou.ps:8000/groups
This is a general purpose PHP API, created for use in Web 2.0
web sites. For a correct definiton of Web 2.0, you may want to check
http://en.wikipedia.org/wiki/Web_2.0
Our API currently has 2 classes:
1) TagCloud.class.php
Feed the class with your own data, and create Web 2.0
style tag clouds
2) Utility.class.php
General purpose functions. For instance getStyledDateDiff gives
nicely formatted date differences that are in use in digg.com and
grou.ps
The APIs are not complete yet. We are open to any ideas, wished coming from
you. Please send us feedback via contact@grou.ps
Usage
============================
1))) Tag Cloud Example
<?php
require_once('/path/to/TagCloud.class.php');
$tc = new TagCloud();
$tc->setMinFontSize(8);
$tc->setMaxFontSize(20);
$tc->setDistributionType(TC_RANDOM_DISTRIBUTION);
$tc->setDataClass('tags');
$tc->addData('love',10);
$tc->addData('sex',20);
$tc->addData('food',5);
$tc->addData('business',1);
$tc->addData('PHP',2);
$res = $tc->generate();
echo $res;
?>
2))) Utility Example
<?php
require_once('/path/to/Utility.class.php');
$start_date = "September 21, 1999";
$end_date = "yesterday";
$u = new Utility();
$datediff = $u->getStyledDateDiff($start_date,$end_date);
$birthday = "11 January 1978";
$zodiacsign = $u->getZodiacSign($birthday);
echo $datediff;
echo "<br />";
echo $zodiacsign;
?>
See more files for this project here