Adam Foust > WWW-Scraper-Delicious-0.10 > WWW::Scraper::Delicious

Download:
WWW-Scraper-Delicious-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.10   Source  

NAME ^

WWW::Scraper::Delicious - Retrieve links from del.icio.us

SYNOPSIS ^

    use WWW::Scraper::Delicious;
    my $delicious = WWW::Scraper::Delicious->new();
    my %linkset = $delicious->getlinks('blahuser');

    map { print "\n".$delicious->dumplink($linkset{$_}) } keys %linkset;

REQUIRED MODULES ^

LWP::UserAgent

EXPORT ^

None.

DESCRIPTION ^

This module implements a very simple and effective way to scrape links from the http://del.icio.us/ site without the requirement of using the del.icio.us API, authentication, or RSS. Although links can be scraped from any valid del.icio.us URL, the intended use of this module is to provide users a simple way to backup and/or mirror their own links. There is no hard limit for the number of user links that can be returned, but a limit of 100 is respected for other types of link queries.

METHODS ^

new()

    $delicious = WWW::Scraper::Delicious->new();
    $delicious = WWW::Scraper::Delicious->new( limit => 5, ua => $ua );

The constructor method returns a WWW::Scraper::Delicious object. The limit and ua arguments are optional. The limit option allows you to restrict the number of results returned (default of 0 is unlimited). You may also pass a custom LWP::UserAgent object handle.

getlinks()

    my %linkset = $delicious->getlinks('blahuser');
    my %linkset = $delicious->getlinks('/blahuser');
    my %linkset = $delicious->getlinks('/blahuser/tag');
    my %linkset = $delicious->getlinks('http://del.icio.us/blahuser/tag');
    my %linkset = $delicious->getlinks('http://del.icio.us/blahuser/tag+tag2');
    my %linkset = $delicious->getlinks('tag/security');

The only argument accepted by the getlinks() method is the del.icio.us URL string of interest. The leading http://del.icio.us/ portion of the URL parameter is optional.

getlinksarray()

    my @links = $delicious->getlinksarray('blahuser');

The argument is the same as with getlinks, but this method returns the link results in the form of a reverse chronologically-ordered array.

ua()

    $delicious->ua($myCustomUA);

This method can be invoked without an argument to obtain the current LWP::UserAgent object handle. Invoking with an argument will establish the new setting.

limit()

    $delicious->limit(9);

This method can be invoked without an argument to obtain the current limit setting (default 0 is unlimited). Invoking with an argument will establish the new setting.

dumplink()

    $delicious->dumplink($linkref);

Returns a text-formatted rendition of a referenced link.

AUTHOR ^

Adam Foust, <agf@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2006, Adam Foust. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: