Parse user stats as ints, not strings, cleanup

This commit is contained in:
Zed
2022-01-16 03:32:18 +01:00
parent 54330f0b0c
commit fcfc1ef497
6 changed files with 18 additions and 19 deletions

View File

@@ -14,11 +14,11 @@ proc parseProfile(js: JsonNode; id=""): Profile =
bio: js{"description"}.getStr,
userPic: js{"profile_image_url_https"}.getImageStr.replace("_normal", ""),
banner: js.getBanner,
following: $js{"friends_count"}.getInt,
followers: $js{"followers_count"}.getInt,
tweets: $js{"statuses_count"}.getInt,
likes: $js{"favourites_count"}.getInt,
media: $js{"media_count"}.getInt,
following: js{"friends_count"}.getInt,
followers: js{"followers_count"}.getInt,
tweets: js{"statuses_count"}.getInt,
likes: js{"favourites_count"}.getInt,
media: js{"media_count"}.getInt,
verified: js{"verified"}.getBool,
protected: js{"protected"}.getBool,
joinDate: js{"created_at"}.getTime