Subject: | time format is wrong |
Given this basic program:
use strict;
use warnings;
use Data::Dumper;
use WWW::Google::SiteMap;
my $map = WWW::Google::SiteMap->new;
my $url = WWW::Google::SiteMap::URL->new(
loc => 'http://foo.com/bar.html',
lastmod => time,
);
# print STDERR Dumper($url);
$map->add($url);
$map->pretty(1);
print $map->xml;
__END__
The generated lastmod is NOT in the accepted Google format. The
hour:minute:second is totally missing:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84
http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://foo.com/bar.html</loc>
<lastmod>2009-08-30T+00:00</lastmod>
</url>
</urlset>
Subject: | test-sitemap.xml |
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://foo.com/bar.html</loc>
<lastmod>2009-08-30T+00:00</lastmod>
</url>
</urlset>
Subject: | test-sitemap.pl |
use strict;
use warnings;
use Data::Dumper;
use WWW::Google::SiteMap;
my $map = WWW::Google::SiteMap->new;
my $url = WWW::Google::SiteMap::URL->new(
loc => 'http://foo.com/bar.html',
lastmod => time,
);
print STDERR Dumper($url);
$map->add($url);
$map->pretty(1);
print $map->xml;