Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sitemapindex = '<?xml version="1.0" encoding="UTF-8"?>\n'
sitemapindex = sitemapindex + '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n'
for file in glob.glob('*.xml'):
sitemapindex = sitemapindex + '<sitemap>\n'
sitemapindex = sitemapindex + ' <loc>http://inkl.in/sitemaps/' + file + '</loc>\n'
sitemapindex = sitemapindex + '</sitemap>\n'
sitemapindex = sitemapindex + '</sitemapindex>'
sitemap = open("/mnt/sitemaps/map.xml", "w")
sitemap.write(sitemapindex)
sitemap.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment