Fix everything (#927)

* Switch bearer token and endpoints, update parser

* Enable user search, disable tweet search

* Disable multi-user timelines for now

* Fix parsing of pinned tombstone
This commit is contained in:
Zed
2023-07-10 11:25:34 +02:00
committed by GitHub
parent dcf73354ff
commit 0bc3c153d9
20 changed files with 260 additions and 264 deletions

View File

@@ -9,12 +9,12 @@ proc parseGraphUser*(json: string): User =
let raw = json.fromJson(GraphUser)
if raw.data.user.result.reason.get("") == "Suspended":
if raw.data.userResult.result.unavailableReason.get("") == "Suspended":
return User(suspended: true)
result = toUser raw.data.user.result.legacy
result.id = raw.data.user.result.restId
result.verified = result.verified or raw.data.user.result.isBlueVerified
result = toUser raw.data.userResult.result.legacy
result.id = raw.data.userResult.result.restId
result.verified = result.verified or raw.data.userResult.result.isBlueVerified
proc parseGraphListMembers*(json, cursor: string): Result[User] =
result = Result[User](

View File

@@ -3,7 +3,7 @@ import user
type
GraphUser* = object
data*: tuple[user: UserData]
data*: tuple[userResult: UserData]
UserData* = object
result*: UserResult
@@ -12,4 +12,4 @@ type
legacy*: RawUser
restId*: string
isBlueVerified*: bool
reason*: Option[string]
unavailableReason*: Option[string]