Implement user_id to screen_name router

This commit is contained in:
jackyzy823 2021-10-04 11:03:40 +01:00
commit 52af6b2746
5 changed files with 47 additions and 2 deletions

View file

@ -40,6 +40,12 @@ proc getProfile*(username: string): Future[Profile] {.async.} =
url = userShow ? ps
result = parseUserShow(await fetch(url, oldApi=true), username)
proc getProfileById*(userId: string): Future[Profile] {.async.} =
let
ps = genParams({"user_id": userId})
url = userShow ? ps
result = parseUserShowId(await fetch(url, oldApi=true), userId)
proc getTimeline*(id: string; after=""; replies=false): Future[Timeline] {.async.} =
let
ps = genParams({"userId": id, "include_tweet_replies": $replies}, after)