aboutsummaryrefslogtreecommitdiff
path: root/wiki-from-email.py
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-10-27 20:11:18 -0500
committerMark Powers <markppowers0@gmail.com>2020-10-27 20:11:18 -0500
commit358ea2d32be88428df0c2739990a117132e98410 (patch)
treeb8756389631b62183c4ece884f7b38f634db9350 /wiki-from-email.py
parent0e58fb890c9b9afe5e438f97c29b6334c0164eda (diff)
Add multiple queries to email utils, add wiki from email.kellyanne
Diffstat (limited to 'wiki-from-email.py')
-rwxr-xr-xwiki-from-email.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/wiki-from-email.py b/wiki-from-email.py
new file mode 100755
index 0000000..a8b39e9
--- /dev/null
+++ b/wiki-from-email.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+
+import email_helper
+import datetime
+import subprocess
+from config import config
+
+def get_wiki_emails():
+ bodies = email_helper.filter_unread("subject", "TODAY", "body date")
+ for b in bodies:
+ d = datetime.datetime.strptime(b["date"], "%a, %d %b %Y %H:%M:%S %z")
+ title = d.strftime("%B %-d")
+ path = d.strftime("%Y/%b/%d").lower()
+ exe = "/home/mark/projects/wikijscmd/main.py"
+ args = [exe, "create", path, title, b["body"]]
+ print(args)
+ subprocess.run(args)
+
+get_wiki_emails()