Cache profiles

This commit is contained in:
Zed
2019-06-20 20:04:18 +02:00
parent 63d7528b8f
commit 6103db6893
8 changed files with 78 additions and 100 deletions

View File

@@ -64,10 +64,10 @@ proc getUserpic*(profile: Profile; style=""): string =
getUserPic(profile.userpic, style)
proc getGifSrc*(tweet: Tweet): string =
fmt"https://video.twimg.com/tweet_video/{tweet.gif}.mp4"
fmt"https://video.twimg.com/tweet_video/{tweet.gif.get()}.mp4"
proc getGifThumb*(tweet: Tweet): string =
fmt"https://pbs.twimg.com/tweet_video_thumb/{tweet.gif}.jpg"
fmt"https://pbs.twimg.com/tweet_video_thumb/{tweet.gif.get()}.jpg"
proc formatName*(profile: Profile): string =
result = xmltree.escape(profile.fullname)