PEAR Manual
Prev |  | Next

# 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:

Example 60-1. Fetching your recent posts
    require_once 'Services/Delicious.php';

    $dlc = &new Services_Delicious($username, $password);

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

Example 60-2. Getting all tags that you used in your bookmarks
    require_once 'Services/Delicious.php';

    $dlc = &new Services_Delicious($username, $password);

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

Example 60-3. Adding a new bookmark
    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';
    }

Prev | Home | Next
Introduction | Up | Services_Ebay