NAME

Search::Sitemap::Ping - Notify search engines of sitemap updates

SYNOPSIS

use Search::Sitemap::Ping;

my $ping = Search::Sitemap::Ping->new(
  'http://www.jasonkohles.com/sitemap.gz',
);

$ping->submit;

for my $url ( $ping->urls ) {
    print "$url\n";
    for my $engine ( $ping->engines ) {
        printf( "    %25s %s\n", $engine, $ping->status( $url, $engine ) );
    }
}

DESCRIPTION

This module makes it easy to notify search engines that your sitemaps, or sitemap indexes, have been updated. See Search::Sitemap and Search::Sitemap::Index for tools to help you create sitemaps and indexes.

METHODS

new

Create a new Search::Sitemap::Ping object.

add_url( @urls )

Add one or more urls to the list of URLs to submit.

urls

Return the list of urls that will be (or were) submitted.

add_engine( @engines )

Add one or more search engines to the list of search engines to submit to.

engines

Return the list of search engines that will be (or were) submitted to.

submit

Submit the urls to the search engines, returns the number of successful submissions. This module uses LWP::UserAgent for the web-based submissions, and will honor proxy settings in the environment. See LWP::UserAgent for more information.

status( $url [, $engine ] )

Returns the status of the indicated submission. The URL must be specified, If an engine is specified it will return just the status of the submission to that engine, otherwise it will return a hashref of the engines that the url will be (or was) submitted to, and the status for each one.

The status may be one of:

  • undef or empty string

    Not submitted yet.

  • 'SUCCESS'

    Succesfully submitted. Note that this just means it was successfully transferred to the search engine, if there are problems in the file the search engine may reject it later when it attempts to use it.

  • HTTP Error String

    In case of an error, the error string will be provided as the status.

MODULE HOME PAGE

The home page of this module is http://www.jasonkohles.com/software/Search-Sitemap. This is where you can always find the latest version, development versions, and bug reports. You will also find a link there to report bugs.

SEE ALSO

Search::Sitemap

AUTHOR

Jason Kohles, <email@jasonkohles.com>

COPYRIGHT AND LICENSE

Copyright (C) 2005-2009 by Jason Kohles

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