Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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