Author image Timothy Appnel

NAME

Net::Trackback::Client - a class for implementing Trackback client functionality.

SYNOPSIS

 use Net::Trackback::Client;
 my $client = Net::Trackback::Client->new();
 my $url ='http://www.foo.org/foo.html';
 my $data = $client->discover($url);
 if (Net::Trackback->is_message($data)) {
    print $data->to_xml;
 } else {
    require Net::Trackback::Ping;
    my $p = {
        ping_url=>'http://www.foo.org/cgi/mt-tb.cgi/40',
        url=>'http://www.timaoutloud.org/archives/000206.html',
        title=>'The Next Generation of TrackBack: A Proposal',
        description=>'I thought it would be helpful to draft some 
            suggestions for consideration for the next generation (NG) 
            of the interface.'
    };
 my $ping = Net::Trackback::Ping->new($p);
 my $msg = $client->send_ping($ping);
 print $msg->to_xml;

METHODS

Net::Trackback::Client->new

Constructor method. Returns a Trackback client instance.

$client->discover($url)

A method that fetches the resource and searches for Trackback ping data. If the given resource can not be retreived or Trackback data was not found, undef is returned. Use the errstr method to get the HTTP status code and message. If successful, returns a reference to an array of Net::Trackback::Data objects.

$client->send_ping($ping)

Executes a ping according to the Net::Trackback::Ping object passed in and returns a Net::Trackback::Message object with the results,

$client->timeout([$seconds])

An accessor to the LWP agent timeout in seconds. Default is 15 seconds. If an optional parameter is passed in the value is set.

$client->proxy($proxy)

The URI of the proxy server to route all requests through. The default is undef -- no proxy.

$client->no_proxy([\@noproxy])

An ARRAY reference of domains to not request through the proxy. If an optional parameter is passed in the value is set. The default list includes localhost and 127.0.0.1.

$client->charset([$charset])

The charset header parameter to use when sending pings. If an optional parameter is passed in the value is set. The default is 'utf-8'.

Errors

This module is a subclass of Class::ErrorHandler and inherits two methods for passing error message back to a caller.

Class->error($message)
$object->error($message)

Sets the error message for either the class Class or the object $object to the message $message. Returns undef.

Class->errstr
$object->errstr

Accesses the last error message set in the class Class or the object $object, respectively, and returns that error message.

AUTHOR & COPYRIGHT

Please see the Net::Trackback manpage for author, copyright, and license information.

6 POD Errors

The following errors were encountered while parsing the POD:

Around line 84:

=begin without a target?

Around line 115:

'=item' outside of any '=over'

Around line 155:

You forgot a '=back' before '=head2'

Around line 160:

'=item' outside of any '=over'

Around line 174:

You forgot a '=back' before '=head1'

Around line 181:

'=end' without a target?