GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::DELICIOUS (3)

.ds Aq ’

NAME

Net::Delicious - OOP for the del.icio.us API

CONTENTS

SYNOPSIS



  use Net::Delicious;
  use Log::Dispatch::Screen;

  my $del = Net::Delicious->new({user => "foo",
                                 pswd => "bar"});

  foreach my $p ($del->recent_posts()) {
      print $p->description()."\n";
  }



DESCRIPTION

OOP for the del.icio.us API

PACKAGE METHODS

    __PACKAGE__->new(\%args || Config::Simple)

Arguments to the Net::Delicious object may be defined in one of three ways :
o As a single hash reference
o As a reference to a Config::Simple object
o As a path to a file that may be read by the Config::Simple.
The first option isn’t going away any time soon but should be considered as deprecated. Valid hash reference arguments are :
o <B>userB>

String. required

Your del.icio.us username.

o <B>pswdB>

String. required

Your del.icio.us password.

o <B>updatesB>

String.

The path to a directory where the timestamp for the last update to your bookmarks can be recorded. This is used by the all_posts method to prevent abusive requests.

Default is the current user’s home directory; If the home directory can not be determined Net::Delicious will use a temporary directory as determined by File::Temp.

o <B>debugB>

Boolean.

Add a Log::Dispatch::Screen dispatcher to log debug (and higher) notices. Notices will be printed to STDERR.

Config::Simple options are expected to be grouped in a block labeled <B>deliciousB>. Valid options are :
o <B>userB>

String. required

Your del.icio.us username.

o <B>pswdB>

String. required

Your del.icio.us password.

o <B>updatesB>

String.

The path to a directory where the timestamp for the last update to your bookmarks can be recorded. This is used by the all_posts method to prevent abusive requests.

Default is the current user’s home directory, followed by a temporary directory as determined by File::Temp.

o <B>xml_parserB>

String.

You may specify one of three XML parsers to use to handle response messages from the del.icio.us servers. You many want to do this if, instead of Perl-ish objects, you want to access the raw XML and parse it with XPath or XSLT or some other crazy moon language.
o <B>simpleB>

This uses XML::Simple to parse messages. If present, all successful API method calls will return, where applicable, Net::Delicious::* objects.

o <B>libxmlB>

This uses XML::LibXML to parse messages. If present, all successful API method calls will return a XML::LibXML::Document object.

Future releases may allow responses parsed with libxml to be returned as Net::Delicious::* objects.

o <B>xpathB>

This uses XML::XPath to parse messages. If present, all successful API method calls will return a XML::XPath object.

Future releases may allow responses parsed with XML::XPath to be returned as Net::Delicious::* objects.

The default value is <B>simpleB>.

o <B>force_xml_objectsB>

Boolean.

Set to true if you are using XML::Simple to parse response messages from the del.icio.us servers but want to return the object’s original data structure rather than Net::Delicious::* objects.

Default is false.

o <B>endpointB>

String.

Set the endpoint for all API calls.

There’s no particular reason you should ever need to set this unless, say, this module falls horribly out of date with the API itself. Anyway, now you can.

Default is <B>https://api.del.icio.us/v1/B>

o <B>debugB>

Boolean.

Add a Log::Dispatch::Screen dispatcher to log debug (and higher) notices. Notices will be printed to STDERR.

Returns a Net::Delicious object or undef if there was a problem creating the object.

It is also possible to set additional config options to tweak the default settings for API call parameters and API response properties. Please consult the POD for Net::Delicious::Config for details.

UPDATE METHODS

CW$obj->update()

Returns return the time of the last update formatted as a W3CDTF string.

POST METHODS

CW$obj->add_post(\%args)

Makes a post to del.icio.us.

Valid arguments are :
o <B>urlB>

String. required

Url for post

o <B>descriptionB>

String.

Description for post.

o <B>extendedB>

String.

Extended for post.

o <B>tagsB>

String.

Space-delimited list of tags.

o <B>dtB>

String.

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

o <B>sharedB>

Boolean. (Technically, you need to pass the string no but N:D will handle 1s and 0s.)

Make the post private. Default is true.

o <B>replaceB>

Boolean. (Technically, you need to pass the string no but N:D will handle 1s and 0s.)

Don’t replace post if given url has already been posted. Default is true.

Returns true or false.

CW$obj->delete_post(\%args)

Delete a post from del.icio.us.

Valid arguments are :
o <B>urlB>

String. required

Returns true or false.

CW$obj->posts_per_date(\%args)

Get a list of dates with the number of posts at each date.

Valid arguments are :
o <B>tagB>

String.

Filter by this tag.

Returns a list of Net::Delicious::Date objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

CW$obj->recent_posts(\%args)

Get a list of most recent posts, possibly filtered by tag.

Valid arguments are :
o <B>tagB>

String.

Filter by this tag.

o <B>countB>

Int.

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

Returns a list of Net::Delicious::Post objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

CW$obj->all_posts()

Returns a list of Net::Delicious::Post objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

If no posts have been added between calls to this method, it will return an empty list (or undef if called in a scalar context.)

CW$obj->posts(\%args)

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 :
o <B>tagB>

String.

Filter by this tag.

o <B>dtB>

String.

Filter by this date.

Returns a list of Net::Delicious::Post objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

TAG METHODS

CW$obj->tags()

Returns a list of tags.

CW$obj->rename_tag(\%args)

Renames tags across all posts.

Valid arguments are :
o <B>oldB>

String. required

Old tag

o <B>newB>

String. required

New tag

Returns true or false.

CW$obj->all_posts_for_tag(\%args)

This is a just a helper method which hides a bunch of API calls behind a single method.

Valid arguments are :
o <B>tagB>

String. required

The tag you want to retrieve posts for.

Returns a list of Net::Delicious::Post objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

BUNDLE METHODS

CW$obj->bundles()

Returns a list of Net::Delicious::Bundle objects when called in an array context.

Returns a Net::Delicious::Iterator object when called in a scalar context.

CW$obj->set_bundle(\%args)

Valid arguments are :
o <B>bundleB>

String. required

The name of the bundle to set.

o <B>tagsB>

String. required

A space-separated list of tags.

Returns true or false

CW$obj->delete_bundle(\%args)

Valid arguments are :
o <B>bundleB>

String. required

The name of the bundle to set

Returns true or false

HELPER METHODS

CW$obj->logger()

Returns a Log::Dispatch object.

CW$obj->config(@args)

This is just a short-cut for calling the current object’s internal Config::Simple param method. You may use to it to get and set config parameters although they will not be saved to disk when the object is destroyed.

CW$obj->username()

Returns the del.icio.us username for the current object.

CW$obj->password()

Returns the del.icio.us password for the current object.

CW$object->user_agent()

This returns the objects internal LWP::UserAgent in case you need to tweak timeouts, proxies, etc.

<B>By default the UA object enables the B>proxy_env<B> glue.B>

ERRORS

Errors are logged via the object’s logger method which returns a Log::Dispatch object. If you want to get at the errors it is up to you to provide it with a dispatcher.

VERSION

1.13

DATE

$Date: 2008/03/03 16:55:04 $

AUTHOR

Aaron Straup Cope <ascope@cpan.org>

SEE ALSO

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

NOTES

This package implements the API in its entirety as of DATE.

LICENSE

Copyright (c) 2004-2008, Aaron Straup Cope. All Rights Reserved.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::DELICIOUS (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.