aboutsummaryrefslogtreecommitdiff
path: root/from_old_blog.py
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2022-03-12 13:41:53 +0100
committeralex <alex@pdp7.net>2022-03-12 13:41:53 +0100
commite87642e5faf6f8e36db097cbda940042a449f239 (patch)
treeb6eb25ac8fc4f8ff3434c88afe134126d5594cf8 /from_old_blog.py
parent2f934cef0303614abec6c66f70b20910927a2a66 (diff)
WIP: importing old blog
Diffstat (limited to 'from_old_blog.py')
-rw-r--r--from_old_blog.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/from_old_blog.py b/from_old_blog.py
new file mode 100644
index 00000000..f35ce241
--- /dev/null
+++ b/from_old_blog.py
@@ -0,0 +1,11 @@
+import yaml
+
+
+with open("post.yml") as f:
+ posts = yaml.load(f)
+
+posts = [dict(post) for post in posts]
+
+for post in posts:
+ post["post"] = post["post"].encode("iso-8859-1").decode("utf8")
+ post["title"] = post["title"].encode("iso-8859-1").decode("utf8") \ No newline at end of file