more changes for scripts - separate API etc.

This commit is contained in:
azivner
2018-01-27 17:18:19 -05:00
parent 005480059a
commit 3f1e73d06b
7 changed files with 202 additions and 71 deletions

View File

@@ -84,12 +84,12 @@ karma: ${comment.score}, created at ${dateTimeStr}</p><p></p>`
let parentNoteId = await getDateNoteIdForReddit(dateTimeStr, rootNoteId);
commentNoteId = await createNote(parentNoteId, comment.link_title, noteText);
log.info("Reddit: Imported comment to note " + commentNoteId);
importedComments++;
await sql.doInTransaction(async () => {
commentNoteId = await createNote(parentNoteId, comment.link_title, noteText);
log.info("Reddit: Imported comment to note " + commentNoteId);
importedComments++;
await attributes.createAttribute(commentNoteId, "reddit_kind", child.kind);
await attributes.createAttribute(commentNoteId, "reddit_id", redditId(child.kind, comment.id));
await attributes.createAttribute(commentNoteId, "reddit_created_utc", comment.created_utc);