nitter/src/types.nim

43 lines
807 B
Nim
Raw Normal View History

2019-06-20 14:16:20 +00:00
import times, sequtils
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
link*: string
text*: string
time*: Time
shortTime*: string
replies*: string
retweets*: string
likes*: string
retweetBy*: string
pinned*: bool
photos*: seq[string]
gif*: string
2019-06-20 15:20:32 +00:00
video*: string
videoThumb*: string
2019-06-20 14:16:20 +00:00
Tweets* = seq[Tweet]
Conversation* = object
tweet*: Tweet
before*: Tweets
after*: Tweets
replies*: seq[Tweets]
proc contains*(thread: Tweets; tweet: Tweet): bool =
thread.anyIt(it.id == tweet.id)