Skip to content

Instantly share code, notes, and snippets.

@justindavies
Created September 14, 2018 11:10
Show Gist options
  • Save justindavies/ebb026bef5bde4ddb8244f619eb8edbb to your computer and use it in GitHub Desktop.
Save justindavies/ebb026bef5bde4ddb8244f619eb8edbb to your computer and use it in GitHub Desktop.
for x in range(int(data["block_number"]), 1, -1):
line = line + "<url>\n"
line = line + "<loc>http://inkl.in/"+str(x)+ "</loc>\n"
line = line + "<changefreq>never</changefreq>"
line = line + "</url>\n"
counter=counter+1
if counter == 50000:
counter = 1
print("Writing " + str(filename))
file = open("/mnt/sitemaps/" + str(filename) + ".xml", "w")
file.write('<?xml version="1.0" encoding="UTF-8"?>\n')
file.write('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n')
file.write(line)
file.write("</urlset>")
file.close()
filename = filename + 1
line = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment