Cache profiles
This commit is contained in:
@@ -1,18 +1,36 @@
|
||||
import times, sequtils
|
||||
import times, sequtils, strutils, options
|
||||
import norm/sqlite
|
||||
|
||||
export sqlite, options
|
||||
|
||||
db("cache.db", "", "", ""):
|
||||
type
|
||||
Profile* = object
|
||||
username*: string
|
||||
fullname*: string
|
||||
description*: string
|
||||
userpic*: string
|
||||
banner*: string
|
||||
following*: string
|
||||
followers*: string
|
||||
tweets*: string
|
||||
verified* {.
|
||||
dbType: "STRING",
|
||||
parseIt: parseBool(it.s)
|
||||
formatIt: $it
|
||||
.}: bool
|
||||
protected* {.
|
||||
dbType: "STRING",
|
||||
parseIt: parseBool(it.s)
|
||||
formatIt: $it
|
||||
.}: bool
|
||||
updated* {.
|
||||
dbType: "INTEGER",
|
||||
parseIt: it.i.fromUnix(),
|
||||
formatIt: getTime().toUnix()
|
||||
.}: Time
|
||||
|
||||
type
|
||||
Profile* = object
|
||||
username*: string
|
||||
fullname*: string
|
||||
description*: string
|
||||
userpic*: string
|
||||
banner*: string
|
||||
following*: string
|
||||
followers*: string
|
||||
tweets*: string
|
||||
verified*: bool
|
||||
protected*: bool
|
||||
|
||||
Tweet* = object
|
||||
id*: string
|
||||
profile*: Profile
|
||||
@@ -23,12 +41,12 @@ type
|
||||
replies*: string
|
||||
retweets*: string
|
||||
likes*: string
|
||||
retweetBy*: string
|
||||
pinned*: bool
|
||||
photos*: seq[string]
|
||||
gif*: string
|
||||
video*: string
|
||||
videoThumb*: string
|
||||
retweetBy*: Option[string]
|
||||
gif*: Option[string]
|
||||
video*: Option[string]
|
||||
videoThumb*: Option[string]
|
||||
|
||||
Tweets* = seq[Tweet]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user