From 8912c53f23eac65f2da2a4de3276ab5be1ea9795 Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 15 Sep 2019 11:14:03 +0200 Subject: [PATCH] Improve RSS validity --- src/formatters.nim | 5 ++++- src/views/rss.nimf | 18 +++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/formatters.nim b/src/formatters.nim index e276bc3..42ce2dd 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -114,7 +114,10 @@ proc getJoinDateFull*(profile: Profile): string = profile.joinDate.format("h:mm tt - d MMM YYYY") proc getTime*(tweet: Tweet): string = - tweet.time.format("d/M/yyyy', ' HH:mm:ss") + tweet.time.format("d/M/yyyy', 'HH:mm:ss") + +proc getRfc822Time*(tweet: Tweet): string = + tweet.time.format("ddd', 'd MMM yyyy HH:mm:ss 'GMT'") proc getLink*(tweet: Tweet | Quote): string = &"/{tweet.profile.username}/status/{tweet.id}" diff --git a/src/views/rss.nimf b/src/views/rss.nimf index d9ee844..f9879c7 100644 --- a/src/views/rss.nimf +++ b/src/views/rss.nimf @@ -43,23 +43,27 @@ #let prefs = Prefs(replaceTwitter: hostname) #result = "" - + - + ${profile.fullname} / @${profile.username} - https://${hostname}${profile.username} - Twitter feed for: ${profile.username}. Generated by ${hostname} + https://${hostname}/${profile.username} + Twitter feed for: @${profile.username}. Generated by ${hostname} en-us 40 - https://${hostname}${getPicUrl(profile.getUserPic(style="_400x400"))} + ${profile.fullname} / @${profile.username} + https://${hostname}/${profile.username} + https://${hostname}${getPicUrl(profile.getUserPic(style="_400x400"))} + 128 + 128 #for tweet in tweets: ${getTitle(tweet, prefs)} - (@${tweet.profile.username}) + @${tweet.profile.username} - ${getTime(tweet)} + ${getRfc822Time(tweet)} https://${hostname}${getLink(tweet)} https://${hostname}${getLink(tweet)}