6 |
|
|
7 |
|
#include <cxx/standard.hh> |
8 |
|
|
9 |
+ |
#include <api/exename.hpp> |
10 |
+ |
#include <api/pcre/regex.hpp> |
11 |
|
#include <api/process.hpp> |
12 |
|
#include <app/simple.hpp> |
13 |
|
#include <xml/textwriter.hpp> |
18 |
|
|
19 |
|
int Main(const app::Options &options) |
20 |
|
{ |
21 |
< |
GoogleTron tron(_B("sitemap.gz")); |
21 |
> |
cse::String sitemap(_B("sitemap.gz")); |
22 |
> |
|
23 |
> |
api::Pcre::RegEx sitemap_(_B("^-sitemap=(.+)$")); |
24 |
> |
|
25 |
> |
_foreach (const app::ArgumentList, arg, app::GetArguments()) |
26 |
> |
{ |
27 |
> |
api::Pcre::RegEx::Match match; |
28 |
> |
|
29 |
> |
if (match = sitemap_(*arg)) |
30 |
> |
sitemap = match[1]; |
31 |
> |
else |
32 |
> |
{ |
33 |
> |
api::Cout << _B("Usage: ") << api::GetExecutablePath().GetName() << _B(" [-sitemap=sitemap]") << ios::NewLine; |
34 |
> |
|
35 |
> |
return 1; |
36 |
> |
} |
37 |
> |
} |
38 |
> |
|
39 |
> |
GoogleTron tron(sitemap); |
40 |
|
|
41 |
|
return 0; |
42 |
|
} |
62 |
|
xml::ScopeElement urlset(writer, _B("urlset")); |
63 |
|
|
64 |
|
writer.SetAttribute(_B("xmlns"), _B("http://www.google.com/schemas/sitemap/0.84")); |
65 |
+ |
writer.SetAttribute(_B("xmlns:xsi"), _B("http://www.w3.org/2001/XMLSchema-instance")); |
66 |
+ |
writer.SetAttribute(_B("xsi:schemaLocation"), _B("http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd")); |
67 |
|
|
68 |
|
do |
69 |
|
{ |