timeline-tweet.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <div class="dtc w-10">
  2. <img loading="lazy" src="{{ tweet.avi_icon_url }}" alt="Avi">
  3. </div>
  4. <div class="dtc w-90 v-top">
  5. <p class="w-100 mt0 pt0">
  6. <strong><a href="{{ tweet.author_url }}" class="w-100">{{ tweet.display_name }}</a></strong>
  7. {% if tweet.author_is_verified %}
  8. <small class="verified">[verified]</small>
  9. {% endif %}
  10. <a href="{{ tweet.author_url }}" class="silver">@{{ tweet.handle }}</a>
  11. <a href="{{ tweet.url }}">{{ tweet.created_at }}</a> [<a href="{{ tweet.source_url }}" target="tweet_{{ tweet.id }}">source</a>]
  12. </p>
  13. <p class="w-100">
  14. {% if tweet.html %}
  15. {{ tweet.html | safe }}
  16. {% else %}
  17. {{ tweet.text | replace('<', '&lt;') | replace('\n', '<br>') | safe }}
  18. {% endif %}
  19. </p>
  20. {% if tweet.quoted_tweet %}
  21. <div class="dt qt-box">
  22. <div class="dt-row">
  23. {% with tweet = tweet.quoted_tweet %}
  24. {% include "partial/timeline-tweet.html" %}
  25. {% endwith %}
  26. </div>
  27. </div>
  28. {% endif %}
  29. {% if not skip_embed_replies %}
  30. {% if tweet.replied_tweet %}
  31. <p style="color: silver">
  32. Replying to:
  33. </p>
  34. <div class="reply_to w-100" style="border: 1px solid silver; padding: 6px">
  35. <div class="dt reply-box">
  36. <div class="dt-row">
  37. {% with tweet = tweet.replied_tweet %}
  38. {% include "partial/timeline-tweet.html" %}
  39. {% endwith %}
  40. </div>
  41. </div>
  42. </div>
  43. {% elif tweet.replied_tweet_id %}
  44. <p style="color: silver">
  45. Replying to:
  46. </p>
  47. {% if tweet.actions.view_replied_tweet %}
  48. <p class="reply_to w-100" style="border: 1px solid silver; padding: 6px">
  49. <a href="{{ url_for(tweet.actions.view_replied_tweet.route, **tweet.actions.view_replies.route_params) }}">View in Thread</a>.
  50. </p>
  51. {% endif %}
  52. {% endif %}
  53. {% endif %}
  54. {% if tweet.note %}
  55. <p class="note w-100" style="border: 1px solid black; background-color: yellow; padding: 6px">
  56. {{ tweet.note.replace('\n', '<br>') | safe }}
  57. </p>
  58. {% endif %}
  59. {% if tweet.photos %}
  60. <p class="w-100">
  61. <ul>
  62. {% for photo in tweet.photos %}
  63. <li><img loading="lazy" class="w-100" src="{{ photo.preview_image_url }}" crossorigin="" referrerpolicy="no-referrer" onclick="this.src='{{ photo.url }}'"></li>
  64. {% endfor %}
  65. </ul>
  66. </p>
  67. {% endif %}
  68. {% if tweet.videos %}
  69. <p class="w-100">
  70. <p>VIDEOS</p>
  71. <ul>
  72. {% for video in tweet.videos %}
  73. <li><img loading="lazy" class="w-100"
  74. src="{{ video.preview_image_url }}" referrerpolicy="no-referrer"
  75. {% if video.image_url %}
  76. onclick="this.src='{{ video.image_url }}'; this.onclick = undefined"
  77. {% endif %}
  78. {% if video.url %}
  79. ondblclick="swapVideoPlayer(this, '{{ video.url }}', '{{ video.content_type }}')"
  80. {% endif %}
  81. >
  82. <dl>
  83. {% if video.duration_str %}
  84. <dt>Duration</dt>
  85. <dd>{{ video.duration_str }}</dt>
  86. {% elif video.duration_ms %}
  87. <dt>Duration</dt>
  88. <dd>{{ video.duration_ms / 1000 / 60 }} minutes</dt>
  89. {% endif %}
  90. </dl>
  91. {% if video.public_metrics and video.public_metrics.view_count %}
  92. <p class="w-100">
  93. view count: {{ video.public_metrics.view_count }}
  94. </p>
  95. {% endif %}
  96. </li>
  97. {% endfor %}
  98. </ul>
  99. </p>
  100. {% endif %}
  101. {% if tweet.card %}
  102. <div class="card-box w-100">
  103. <p><a href="{{ tweet.card.source_url }}">{{ tweet.card.display_url }}</a></p>
  104. <p><strong>{{ tweet.card.title }}</strong></p>
  105. <p>{{ tweet.card.content }}</p>
  106. </div>
  107. {% endif %}
  108. {% if False and tweet.replied_tweet %}
  109. <a href="{{ tweet.replied_tweet.url }}">View Parent</a>
  110. <a href="{{ url_for('.get_tweet_html', tweet_id=tweet.replied_tweet.conversation_id) }}">View Conversation</a>
  111. {% endif %}
  112. {% if tweet.public_metrics %}
  113. <p class="w-100">
  114. {% for k, v in tweet.public_metrics.items() %}
  115. {% if v != None %}
  116. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  117. {% endif %}
  118. {% endfor %}
  119. </p>
  120. {% endif %}
  121. {% if tweet.non_public_metrics %}
  122. <p class="w-100">
  123. {% for k, v in tweet.non_public_metrics.items() %}
  124. {% if v != None %}
  125. {{ k.replace('_count', 's').replace('ys', 'ies').replace('_', ' ') }}: {{ v }},
  126. {% endif %}
  127. {% endfor %}
  128. </p>
  129. {% endif %}
  130. {% if tweet.attachments %}
  131. <ul>
  132. {% for a in tweet.attachments %}
  133. {% if a.content_type == 'application/vnd-hogumathi.livestream-details+json' %}
  134. <li class="livestream-details">
  135. <dl>
  136. {% if a.content.scheduled_start_time %}
  137. <dt>Scheduled Start Time</dt>
  138. <dd>{{ a.content.scheduled_start_time }}</dd>
  139. {% endif %}
  140. {% if a.content.start_time %}
  141. <dt>Start Time</dt>
  142. <dd>{{ a.content.start_time }}</dd>
  143. {% endif %}
  144. {% if a.content.chat_embed_url %}
  145. <dt>Chat</dt>
  146. <dd>
  147. <iframe class="w-100" height="400" src="{{ a.content.chat_embed_url }}" referrerpolicy="origin"></iframe>
  148. </dd>
  149. {% endif %}
  150. </dl>
  151. </li>
  152. {% else %}
  153. <li><a href="{{ a.url }}">{{ a.name }}</a> {{ a.content_type }} ({{ a.size }})
  154. {% endif %}
  155. </li>
  156. {% endfor %}
  157. </ul>
  158. {% endif %}
  159. {% if show_conversation_id %}
  160. <p class="w-100">
  161. Conversation: {{ tweet.conversation_id }}
  162. </p>
  163. {% endif %}
  164. </div>