-
Notifications
You must be signed in to change notification settings - Fork 0
/
sitemapMaker.py
37 lines (26 loc) · 910 Bytes
/
sitemapMaker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#/usr/bin/python3
# -*- coding: utf-8 -*-
'''
Gera um sitemap no formato texto do site
do projeto REAMAT.
http://www.ufrgs.br/reamat
Autor: Pedro H A Konzen - 01/2018
'''
import os
from os import walk
import numpy as np
import string
ofile = open("./on_server/sitemap.txt", "w")
#find and get all html
htmlFiles = []
for (dirpath, dirnames, filenames) in walk ("./on_server"):
for (dirpath1, dirnames1, filenames1) in walk(dirpath):
if (dirpath1[:19] != "./on_server/MathJax"):
for filename in filenames1:
ext = os.path.splitext(filename)[1]
if (ext == ".html"):
print("%s/%s" % (dirpath1,filename))
ofile.write("https://www.ufrgs.br/reamat" +
dirpath[11:]+"/"+filename+"\n") # acrescentei 'reamat' -- Fabio (24 de abril de 2018)
break
ofile.close()