PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » Services_Delicious » Manual

Object-oriented abstraction for del.icio.us XML API.

Introduction

Introduction – Introduction to Services_Delicious

Introduction to Services_Delicious

Services_Delicious is an abstraction for the webservice of the social bookmarking site del.icio.us. del.icio.us allows you to easily add sites you like to your personal collection of links, to categorize those sites with keywords, and to share your collection not only between your own browsers and machines, but also with others.

del.icio.us is using "tags" to categorize your bookmarks and allows other users to browse bookmarks by topic.

Services_Delicious enables you to access, add and even delete your social bookmarks by using a Services_Delicious class that provides functions like getAllPosts(), addPost() or deletePost().

Example

Example – Basic examples of Services_Delicious

Basic examples of Services_Delicious

The following examples show how to use some basic features of Services_Delicious:

Fetching your recent posts

<?php
require_once 'Services/Delicious.php';
    
$dlc = &new Services_Delicious($username, $password);

$posts = $dlc->getRecentPosts();
echo '<pre>';
print_r($posts);
echo '</pre>';
?>

Getting all tags that you used in your bookmarks

<?php
require_once 'Services/Delicious.php';
    
$dlc = &new Services_Delicious($username, $password);

$tags = $dlc->getTags();
echo '<pre>';
print_r($tags);
echo '</pre>';
?>

Adding a new bookmark

<?php
require_once 'Services/Delicious.php';
    
$dlc = &new Services_Delicious($username, $password);

$result = $dlc->addPost('http://pear.php.net', 'PEAR', 'The PHP Extension and Application Repository', 'php');
if (PEAR::isError($result)) {
  die($result->getMessage());
} else {
  echo 'Success';
}
?>