mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 14:49:32 +00:00
parent
662ae90e22
commit
32b04a772b
1 changed files with 21 additions and 2 deletions
|
|
@ -28,6 +28,24 @@
|
||||||
Twitter feed for: ${desc}. Generated by ${cfg.hostname}
|
Twitter feed for: ${desc}. Generated by ${cfg.hostname}
|
||||||
#end proc
|
#end proc
|
||||||
#
|
#
|
||||||
|
#proc getTweetsWithPinned(profile: Profile): seq[Tweets] =
|
||||||
|
#result = profile.tweets.content
|
||||||
|
#if profile.pinned.isSome and result.len > 0:
|
||||||
|
# let pinnedTweet = profile.pinned.get
|
||||||
|
# var inserted = false
|
||||||
|
# for threadIdx in 0 ..< result.len:
|
||||||
|
# if not inserted:
|
||||||
|
# for tweetIdx in 0 ..< result[threadIdx].len:
|
||||||
|
# if result[threadIdx][tweetIdx].id < pinnedTweet.id:
|
||||||
|
# result[threadIdx].insert(pinnedTweet, tweetIdx)
|
||||||
|
# inserted = true
|
||||||
|
# end if
|
||||||
|
# end for
|
||||||
|
# end if
|
||||||
|
# end for
|
||||||
|
#end if
|
||||||
|
#end proc
|
||||||
|
#
|
||||||
#proc renderRssTweet(tweet: Tweet; cfg: Config): string =
|
#proc renderRssTweet(tweet: Tweet; cfg: Config): string =
|
||||||
#let tweet = tweet.retweet.get(tweet)
|
#let tweet = tweet.retweet.get(tweet)
|
||||||
#let urlPrefix = getUrlPrefix(cfg)
|
#let urlPrefix = getUrlPrefix(cfg)
|
||||||
|
|
@ -106,8 +124,9 @@ Twitter feed for: ${desc}. Generated by ${cfg.hostname}
|
||||||
<width>128</width>
|
<width>128</width>
|
||||||
<height>128</height>
|
<height>128</height>
|
||||||
</image>
|
</image>
|
||||||
#if profile.tweets.content.len > 0:
|
#let tweetsList = getTweetsWithPinned(profile)
|
||||||
${renderRssTweets(profile.tweets.content, cfg, userId=profile.user.id)}
|
#if tweetsList.len > 0:
|
||||||
|
${renderRssTweets(tweetsList, cfg, userId=profile.user.id)}
|
||||||
#end if
|
#end if
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue