git ssb

0+

Grey the earthling / scuttleblog



Commit 24bbe5ac261810315d4922e0fd0071a403007e34

Make userid configurable

Fix posts' datetimes
Output to the right folder for Hugo
Greg K Nicholson committed on 10/15/2017, 12:34:19 AM
Parent: 3b2f28bf55a5e4e16521028ecddad93b96d90a60

Files changed

conf.pychanged
scuttleblog.pychanged
conf.pyView
@@ -1,1 +1,2 @@
11 userid = "@JoiN9c9+xO0jgu0gg5yflTf+L1peLTBneFHjrKbmcKo=.ed25519"
2 +
scuttleblog.pyView
@@ -25,22 +25,22 @@
2525 import json
2626 import os
2727 import subprocess
2828
29-userid = '@JoiN9c9+xO0jgu0gg5yflTf+L1peLTBneFHjrKbmcKo=.ed25519'
29 +import conf
3030
3131 def restructure(p):
3232 post = {}
3333 post['sequence'] = p['value']['sequence']
3434 post['frontmatter'] = {}
3535 post['frontmatter']['key'] = p['key']
36- post['frontmatter']['date'] = datetime.datetime.fromtimestamp(int(p['value']['timestamp'] / 1000), datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%S%z')
36 + post['frontmatter']['date'] = datetime.datetime.fromtimestamp(int(p['value']['timestamp'] / 1000), datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
3737 post['frontmatter']['sequence'] = p['value']['sequence']
3838 post['text'] = p['value']['content']['text']
3939 return (post)
4040
4141 def defineFilename(post):
42- folder = 'output'
42 + folder = 'hugo/content/posts'
4343 #slug = post['key'].replace('+','-').replace('/','_').replace('=.sha256','')
4444 slug = str(post['sequence'])
4545 filetype = 'md'
4646 return folder + '/' + slug + '.' + filetype
@@ -65,6 +65,6 @@
6565 jsonPosts = json.loads(posts)
6666 for post in jsonPosts:
6767 writePostFile(restructure(post))
6868
69-getUserStream(userid)
69 +getUserStream(conf.userid)
7070

Built with git-ssb-web