Browse Source

createdAt -> collectedAt

master
Wesley Kerfoot 4 years ago
parent
commit
38693714fe
  1. 10
      src/tweetlogpkg/server.nim

10
src/tweetlogpkg/server.nim

@ -15,7 +15,7 @@ type TwitterThread = ref object of RootObj
tweetID: string tweetID: string
tweets: string tweets: string
author: Author author: Author
createdAt: DateTime collectedAt: DateTime
const dateFmt = "YYYY-MM-dd hh:mm:ss" const dateFmt = "YYYY-MM-dd hh:mm:ss"
@ -89,7 +89,7 @@ proc threadExists(threadID : string, authorName : string) : Option[TwitterThread
tweetID: row[1], tweetID: row[1],
author: author.get, author: author.get,
tweets: row[2], tweets: row[2],
createdAt: row[3].parse(dateFmt) collectedAt: row[3].parse(dateFmt)
) )
) )
@ -117,7 +117,7 @@ proc insertThread(thread : TwitterThread) =
db.exec(sql"INSERT INTO threads (tid, tweets, collectedAt, authorID) VALUES (?, ?, ?, ?)", db.exec(sql"INSERT INTO threads (tid, tweets, collectedAt, authorID) VALUES (?, ?, ?, ?)",
thread.tweetID, thread.tweetID,
thread.tweets, thread.tweets,
thread.createdAt.format(dateFmt), thread.collectedAt.format(dateFmt),
author.get.authorID) author.get.authorID)
# Routes # Routes
@ -151,7 +151,7 @@ router twitblog:
let tweets = thread.get.tweets.split("\n") let tweets = thread.get.tweets.split("\n")
resp tweetThread(author, resp tweetThread(author,
thread.get.tweets.split("\n"), thread.get.tweets.split("\n"),
thread.get.createdAt.format(dateFmt)) thread.get.collectedAt.format(dateFmt))
else: else:
# Send it off to the rendering thread for processing # Send it off to the rendering thread for processing
# Let them know to check back later # Let them know to check back later
@ -195,6 +195,6 @@ proc handleRenders* =
tweetID: t.tweetID, tweetID: t.tweetID,
author: t.author, author: t.author,
tweets: tweets.get.join("\n"), tweets: tweets.get.join("\n"),
createdAt: now().utc collectedAt: now().utc
) )
) )

Loading…
Cancel
Save