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 // 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 foreach ($bookmarks['bookmarks'] as $row) {
21 echo '<update time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) .'" />';