Implement link previews

This commit is contained in:
Zed
2019-08-07 22:02:19 +02:00
parent afdbb6ad9e
commit ec5f67123a
5 changed files with 44 additions and 9 deletions

View File

@@ -68,9 +68,15 @@ proc getUserpic*(userpic: string; style=""): string =
proc getUserpic*(profile: Profile; style=""): string =
getUserPic(profile.userpic, style)
proc getVideoEmbed*(video: Video): string =
&"https://twitter.com/i/videos/{video.videoId}?embed_source=facebook"
proc pageTitle*(profile: Profile): string =
&"{profile.fullname} (@{profile.username})"
proc pageDesc*(profile: Profile): string =
"The latest tweets from " & profile.fullname
proc getTime*(tweet: Tweet): string =
tweet.time.format("d/M/yyyy', ' HH:mm:ss")