- Enforce minimum elapsed time on registration form
[scuttle] / api / tags_get.php
1 <?php
2 // Implements the del.icio.us API request for all a user's tags.
3
4 // del.icio.us behavior:
5 // - tags can't have spaces
6
7 // Force HTTP authentication first!
8 require_once 'httpauth.inc.php';
9 require_once '../header.inc.php';
10
11 $tagservice  =& ServiceFactory::getServiceInstance('TagService');
12 $userservice =& ServiceFactory::getServiceInstance('UserService');
13
14 // Get the tags relevant to the passed-in variables.
15 $tags =& $tagservice->getTags($userservice->getCurrentUserId());
16
17 // Set up the XML file and output all the tags.
18 header('Content-Type: text/xml');
19 echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
20 echo "<tags>\r\n";
21 foreach ($tags as $row) {
22   echo "\t<tag count=\"". $row['bCount'] .'" tag="'. filter(convertTag($row['tag'], 'out'), 'xml') ."\" />\r\n";
23 }
24 echo "</tags>";

Benjamin Mako Hill || Want to submit a patch?