mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 15:19:32 +00:00
parent
446f06f9d6
commit
c136e47748
1 changed files with 34 additions and 5 deletions
|
|
@ -34,6 +34,12 @@
|
||||||
# end case
|
# end case
|
||||||
# end if
|
# end if
|
||||||
#end if
|
#end if
|
||||||
|
#if result.len == 0 and tweet.card.isSome:
|
||||||
|
# let card = tweet.card.get()
|
||||||
|
# if card.kind notin {hidden, unknown} and card.title.len > 0:
|
||||||
|
# result = prefix & xmltree.escape(card.title)
|
||||||
|
# end if
|
||||||
|
#end if
|
||||||
#end proc
|
#end proc
|
||||||
#
|
#
|
||||||
#proc getDescription(desc: string; cfg: Config): string =
|
#proc getDescription(desc: string; cfg: Config): string =
|
||||||
|
|
@ -60,6 +66,32 @@ Twitter feed for: ${desc}. Generated by ${getUrlPrefix(cfg)}
|
||||||
#end case
|
#end case
|
||||||
#end proc
|
#end proc
|
||||||
#
|
#
|
||||||
|
#proc renderRssCard(card: Card; prefs: Prefs; urlPrefix: string): string =
|
||||||
|
#let cardLink = if card.url.startsWith("/"): urlPrefix & card.url else: replaceUrls(card.url, prefs)
|
||||||
|
#let title = xmltree.escape(card.title)
|
||||||
|
#if cardLink.len > 0:
|
||||||
|
<a href="${xmltree.escape(cardLink)}">
|
||||||
|
#end if
|
||||||
|
#if card.image.len > 0:
|
||||||
|
<img src="${urlPrefix}${getPicUrl(card.image)}" style="max-width:250px;" />
|
||||||
|
#end if
|
||||||
|
#if title.len > 0:
|
||||||
|
# if card.image.len > 0:
|
||||||
|
<br>
|
||||||
|
# end if
|
||||||
|
<b>${title}</b>
|
||||||
|
#end if
|
||||||
|
#if cardLink.len > 0:
|
||||||
|
</a>
|
||||||
|
#end if
|
||||||
|
#if card.text.len > 0:
|
||||||
|
<p>${xmltree.escape(card.text)}</p>
|
||||||
|
#end if
|
||||||
|
#if card.dest.len > 0:
|
||||||
|
<small>${xmltree.escape(card.dest)}</small>
|
||||||
|
#end if
|
||||||
|
#end proc
|
||||||
|
#
|
||||||
#proc getTweetsWithPinned(profile: Profile): seq[Tweets] =
|
#proc getTweetsWithPinned(profile: Profile): seq[Tweets] =
|
||||||
#result = profile.tweets.content
|
#result = profile.tweets.content
|
||||||
#if profile.pinned.isSome and result.len > 0:
|
#if profile.pinned.isSome and result.len > 0:
|
||||||
|
|
@ -87,11 +119,8 @@ Twitter feed for: ${desc}. Generated by ${getUrlPrefix(cfg)}
|
||||||
# for media in tweet.media:
|
# for media in tweet.media:
|
||||||
${renderRssMedia(media, tweet, urlPrefix)}
|
${renderRssMedia(media, tweet, urlPrefix)}
|
||||||
# end for
|
# end for
|
||||||
#elif tweet.card.isSome:
|
#elif tweet.card.isSome and tweet.card.get().kind notin {hidden, unknown}:
|
||||||
# let card = tweet.card.get()
|
${renderRssCard(tweet.card.get(), prefs, urlPrefix)}
|
||||||
# if card.image.len > 0:
|
|
||||||
<img src="${urlPrefix}${getPicUrl(card.image)}" style="max-width:250px;" />
|
|
||||||
# end if
|
|
||||||
#end if
|
#end if
|
||||||
#if tweet.note.len > 0 and not prefs.hideCommunityNotes:
|
#if tweet.note.len > 0 and not prefs.hideCommunityNotes:
|
||||||
<p><b>Community note:</b> ${replaceUrls(tweet.note, prefs, absolute=urlPrefix)}</p>
|
<p><b>Community note:</b> ${replaceUrls(tweet.note, prefs, absolute=urlPrefix)}</p>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue