Skip to content

Instantly share code, notes, and snippets.

@justindavies
Created September 14, 2018 11:11
Show Gist options
  • Save justindavies/6153e2a607cb93462c63911ac99d3d29 to your computer and use it in GitHub Desktop.
Save justindavies/6153e2a607cb93462c63911ac99d3d29 to your computer and use it in GitHub Desktop.
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