00001 #include <stdio.h> 00002 #include <time.h> 00003 00004 const char head[] = 00005 "<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>\n" 00006 "<urlset\n" 00007 " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n" 00008 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" 00009 " xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9\n" 00010 " http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n"; 00011 00012 int main(int argc, char *argv[]) 00013 { 00014 int i; 00015 time_t timer = time(NULL); 00016 struct tm t = *localtime(&timer); 00017 00018 puts(head); 00019 printf( 00020 "<url>\n" 00021 " <loc>http://doxysrc.dotera.net/</loc>\n" 00022 " <priority>1.0</priority>\n" 00023 " <lastmod>%04d-%02d-%02dT%02d:%02d:%02d+09:00</lastmod>\n" 00024 " <changefreq>daily</changefreq>\n" 00025 "</url>\n", 00026 t.tm_year+1900, t.tm_mon+1, t.tm_mday, 00027 t.tm_hour, t.tm_min, t.tm_sec); 00028 for (i = 1; i < argc; i++) 00029 { 00030 printf( 00031 "<url>\n" 00032 " <loc>http://doxysrc.dotera.net/%s</loc>\n" 00033 " <priority>0.5</priority>\n" 00034 " <lastmod>%04d-%02d-%02dT%02d:%02d:%02d+09:00</lastmod>\n" 00035 " <changefreq>daily</changefreq>\n" 00036 "</url>\n", 00037 argv[i], 00038 t.tm_year+1900, t.tm_mon+1, t.tm_mday, 00039 t.tm_hour, t.tm_min, t.tm_sec); 00040 } 00041 puts("</urlset>"); 00042 return 0; 00043 } 00044