Improve comments UI
Adds author like and sytles better
This commit is contained in:
parent
ea184ef316
commit
ed055be0b5
@ -3,23 +3,28 @@
|
||||
<div class="content">
|
||||
{% if comment.authorIsChannelOwner %}
|
||||
|
||||
<a class="author" href="{{comment.channel}}"><i class="red user circle icon"></i>{{comment.author}}</a>
|
||||
<a class="author" style="color: red;" href="{{comment.channel}}"><i class="red user circle icon"></i>{{comment.author}}</a>
|
||||
{% else %}
|
||||
<a class="author" href="{{comment.channel}}">{{comment.author}}</a>
|
||||
{% endif %}
|
||||
<div class="metadata">
|
||||
<div class="date">{{comment.date}}</div>
|
||||
<div class="rating">
|
||||
<i class="thumbs up icon"></i>
|
||||
{{comment.likes}}
|
||||
<div class="metadata">
|
||||
<div class="date">{{comment.date}}</div>
|
||||
</div>
|
||||
<div class="rating">
|
||||
<i class="comment icon"></i>
|
||||
{{comment.replies}}
|
||||
<div class="text">
|
||||
{{comment.text}}
|
||||
</div>
|
||||
<div class="metadata">
|
||||
<div class="rating">
|
||||
<i class="comment icon"></i>
|
||||
{{comment.replies}}
|
||||
</div>
|
||||
<div class="rating">
|
||||
<i class="thumbs up icon"></i>
|
||||
{{comment.likes}}
|
||||
</div>
|
||||
{%if comment.creatorHeart != false%}
|
||||
<i class="small red heart icon"></i><img class="ui circular image" style="width: 15px; height: 15px;" src="{{comment.creatorHeart}}">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text">
|
||||
{{comment.text}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -82,6 +82,7 @@ def concat_texts(strings):
|
||||
|
||||
def parse_comment(raw_comment):
|
||||
cmnt = {}
|
||||
print(raw_comment)
|
||||
raw_comment = raw_comment['commentThreadRenderer']['comment']['commentRenderer']
|
||||
imgHostName = urllib.parse.urlparse(raw_comment['authorThumbnail']['thumbnails'][0]['url']).netloc
|
||||
cmnt['author'] = raw_comment['authorText']['runs'][0]['text']
|
||||
@ -90,6 +91,11 @@ def parse_comment(raw_comment):
|
||||
cmnt['text'] = Markup(bleach.linkify(concat_texts(raw_comment['contentText']['runs']).replace("\n", "<br>")))
|
||||
cmnt['date'] = raw_comment['publishedTimeText']['runs'][0]['text']
|
||||
|
||||
try:
|
||||
cmnt['creatorHeart'] = raw_comment['creatorHeart']['creatorHeartRenderer']['creatorThumbnail']['thumbnails'][0]['url']
|
||||
except:
|
||||
cmnt['creatorHeart'] = False
|
||||
|
||||
try:
|
||||
cmnt['likes'] = raw_comment['likeCount']
|
||||
except:
|
||||
|
Reference in New Issue
Block a user