Compare commits
2 Commits
8429587238
...
9784a9ccba
Author | SHA1 | Date |
---|---|---|
n | 9784a9ccba | |
n | fb726f6cca |
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
''' fetch (almost) all blog posts from Dotclear database and export them in Markdown format '''
|
||||
''' TODO: use rss/atom feed instead '''
|
||||
''' TODO: convert to proper Gemtext '''
|
||||
'''fetch (almost) all blog posts from Dotclear database and export them in Markdown format
|
||||
TODO: use rss/atom feed instead
|
||||
TODO: convert to proper Gemtext'''
|
||||
|
||||
import os
|
||||
import re
|
||||
|
@ -39,11 +39,11 @@ with open("index.gmi", "w", encoding="utf-8") as f:
|
|||
|
||||
for x in myresult:
|
||||
path = path_regex.findall(x[0])[0]
|
||||
filename = filename_regex.findall(x[0])[0]
|
||||
path_with_dashes = path.replace("/","-")
|
||||
filename = quote(quote(filename_regex.findall(x[0])[0]))
|
||||
|
||||
with open("index.gmi", "a", encoding="utf-8") as f:
|
||||
f.write('=> {0}/{1}.gmi {2} - {3}\n'
|
||||
.format(path, quote(quote(filename)), path.replace("/","-"), x[1]))
|
||||
f.write(f'=> {path}/{filename}.gmi {path_with_dashes} - {x[1]}\n')
|
||||
|
||||
try:
|
||||
if not os.path.exists(path):
|
||||
|
|
Loading…
Reference in New Issue