tril now gives me back a title and content of blogs

This commit is contained in:
2024-11-12 23:29:11 +10:00
parent 72a8428271
commit 858f7c8d0a
2 changed files with 18 additions and 3 deletions
+14 -1
View File
@@ -4,7 +4,7 @@ import os
class TrilumNotes:
def __init__(self):
self.protocol = os.environ.get('TRILUM_PROTOCOL')
self.protocol = os.environ.get('TRILIUM_PROTOCOL')
self.host = os.environ.get('TRILIUM_HOST')
self.port = os.environ.get('TRILIUM_PORT')
self.tril_pass = os.environ.get('TRILIUM_PASS')
@@ -34,3 +34,16 @@ class TrilumNotes:
)
self.new_notes = notes
return notes
def _get_content(self, note_id):
return self.ea.get_note_content(note_id)
def get_notes_content(self):
content_dict = {}
for note in self.new_notes['results']:
content_dict[note['noteId']] = {"title" : f"{note['title']}",
"content" : f"{self._get_content(note['noteId'])}"
}
self.note_content = content_dict
return content_dict