Index of /javascript/delicious

      Name                    Last modified       Size  Description

[DIR] Parent Directory 25-Aug-2007 14:49 - [TXT] Changes 17-Nov-2004 16:49 1k [DIR] autodiscovery/ 23-Nov-2004 11:15 - [   ] delicious-1.0.tar.gz 17-Nov-2004 16:49 5k

NAME
    delicious.js - JavaScript interface to the del.icio.us API

SYNOPSIS
     <script type = "text/javascript" src = "delicious.js" />
     <script type = "text/javascript" src = "xmlp/xmlp.js" />

     # you'll need to do this under Mozilla/Gecko (but not Safari)        
     # netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");

     var del = new Delicious({'username':'foo',
                              'password':'bar'});

     var posts = del.posts({'tag':'baz'});

     if (! posts) {
        alert(del.last_error());
        return false;
     }

     for (var i = 0; i < posts.length; i++) {
        var post = posts[i];

        alert(post.description() + ":" + post.href());
     }

DESCRIPTION
    JavaScript interface to the del.icio.us API.

    This library is not asynchronous. Additionally, it has built-in code to
    throttle abusive requests : a mandatory pause of 1 second between
    requests to the del.icio.us server.

REQUIREMENTS
    * http://www.gazingus.org/html/XML_Parser_in_JavaScript.html
        For reasons unknown, some of the responses sent by the del.icio.us
        server are not handled correctly by the *XMLHttpRequest* object.
        Specifically, the return value of the responseXML method returns
        nothing.

        Instead, we parse the value of the responseText method by hand hence
        the need for an XML parser.

Delicious CLASS METHODS
new Delicious({key:value})
    Valid arguments are :

    * username
        String; *required*.

    * password
        String; *required*.

    * retry
        Boolean.

        If true, when a method encounters an HTTP 503 error from the
        del.icio.us servers it will retry the request, not exceeding 10
        times.

        The pause between each request will increase incrementally so, given
        the non-asynchronous nature of the library, you should set this flag
        carefully.

        This flag does not affect the built-in throttling that occurs
        between any other response/request cycle.

        Default is false.

    Returns a Delicious object.

Delicious OBJECT METHODS
  delicious.posts({key:value})
    Get a list of posts on a given date, filtered by tag. If no date is
    supplied, most recent date will be used.

    Valid arguments are :

    * tag
        String.

        Filter by this tag.

    * dt
        String.

        Filter by this date.

    Returns an array of *Post* objects.

  delicious.posts_per_date({key:value})
    Get a list of dates with the number of posts at each date.

    Valid arguments are :

    * tag
        String.

        Filter by this tag.

    Returns an array of *Date* objects. This method is currently not
    available.

  delicious.recent_posts({key:value})
    Get a list of most recent posts, possibly filtered by tag.

    Valid arguments are :

    * tag
        String.

        Filter by this tag.

    * count
        Int.

        Number of posts to return. Default is 20; maximum is 100.

    Returns an array of *Post* objects.

  delicious.all_posts()
    Returns an array or *Post* objects.

  delicious.add_post(Array())
    Makes a post to del.icio.us.

    Valid arguments are :

    * url
        String; *required*

    * description
        String.

        Description for post.

    * extended
        String.

        Extended description for post.

    * tags
        String.

        Space-delimited list of tags.

    * dt
        String.

        Datestamp for post, format "CCYY-MM-DDThh:mm:ssZ".

    Returns true or false.

  delicious.delete_post({key:value})
    Delete a post from del.icio.us.

    Valid arguments are :

    * url
        String; *required*.

    Returns true or false.

  delicious.tags()
    Returns an array of *Tag* objects.

  delicious.rename_tag({key:value})
    Renames tags across all posts.

    Valid arguments are :

    * old
        String; *required*.

    * new
        String; *required*.

    Returns true or false.

  delicious.last_error()
    Returns an *Error* object.

Post OBJECT METHODS
    A *Post* object's toString() method is set up to return the value of its
    href method.

  post.href()
    Returns a string.

  post.description()
    Returns a string.

  post.extended()
    Returns a string.

  post.tag()
    Returns a string value of the tag list passed by the del.icio.us server.

  post.tags()
    Returns the tag list as an array of *Tag* objects.

  post.time()
    Returns a string, formatted YYYY-MM-DD

Tag OBJECT METHODS
    A *Tag* object's toString() method is set up to return the value of the
    tag itself.

  tag.count()
    Returns an int.

Error OBJECT METHODS
    An *Error* object's toString() method is set up to return the string
    concatenated of its code and errstr methods.

  error.code()
    Returns the error code reported by, or to, the object.

  error.errstr()
    Returns the optional error string reported by, or to, the object.

VERSION
    1.0

DATE
    $Date: 2004/11/17 21:47:05 $

AUTHOR
    Aaron Straup Cope <http://www.aaronstraupcope.com>

SEE ALSO
    http://del.icio.us/doc/api

LICENSE
    Copyright (c) 2004 Aaron Straup Cope. All Rights Reserved.

    This is free software, you may use it and distribute it under the same
    terms as the Perl Artistic License.