2 // Implements the del.icio.us API request for a user's last update time and date.
4 // del.icio.us behavior:
5 // - doesn't set the Content-Type to text/xml (we do).
7 // Force HTTP authentication first!
8 require_once('httpauth.inc.php');
9 require_once('../header.inc.php');
11 $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
12 $userservice =& ServiceFactory::getServiceInstance('UserService');
14 // Get the posts relevant to the passed-in variables.
15 $bookmarks =& $bookmarkservice->getBookmarks(0, 1, $userservice->getCurrentUserId());
17 $currentuser = $userservice->getCurrentUser();
18 $currentusername = $currentuser[$userservice->getFieldName('username')];
20 // Set up the XML file and output all the tags.
21 header('Content-Type: text/xml');
22 echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
23 foreach($bookmarks['bookmarks'] as $row) {
24 echo '<update time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) .'" />';