我正在使用以下 html 脚本在我的网页上包含 twitter。问题是:它以丑陋的方式显示回复、转发和推文(将所有内容视为相同,并简单地将它们逐个列出)。有没有办法完全删除转推和回复,或者至少改进格式?
<link href="https://fonts.googleapis.com/css2?family=Cabin&display=swap" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
<!-- Twitter Embed Code, check options here: https://developer.twitter.com/en/docs/twitter-for-websites/timelines/overview -->
<div class="twitter-feed">
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- Twitter Embed Code -->
<a class="twitter-timeline" href="https://twitter.com/greatbritain"-
data-chrome="nofooter noborders transparent noscrollbar"
data-tweet-limit="8" dnt="true">Test</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
<!-- / Twitter Embed Code -->
</div>
</div>
</div>
</div>
<!-- / Twitter Embed Code -->
<script>
$('.twitter-feed').delegate('#twitter-widget-0', 'DOMSubtreeModified propertychange', function () {
customizeTweetMedia();
});
var customizeTweetMedia = function () {
// CSS Overrides
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Header').css('display','none');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Header').css('background-color','#e6e6e6');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Header-title').css('border-collapse','separate');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Header-title').css('border-radius','25px');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-').css('border-radius','25px');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Header-byline').remove();
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-InformationCircle').remove();
$('.twitter-feed').find('.twitter-timeline').contents().find('img.Avatar').css('display', 'none');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-author').remove();
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-media').css('width','80%');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-media').css('margin','auto');
$('.twitter-feed').find('.twitter-timeline').contents().find('span.TweetAuthor-avatar.Identity-avatar').remove();
$('.twitter-feed').find('.twitter-timeline').contents().find('span.TweetAuthor-screenName').css('font-size', '18px');
$('.twitter-feed').find('.twitter-timeline').contents().find('span.TweetAuthor-screenName').css('font-family', 'Baloo 2');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-TweetList-tweet').css('border-bottom','2px solid #cfcfcf');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('margin-bottom', '0px');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('margin-left', '12px');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('margin-inline-start', '12px');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-metadata').css('float','left');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Tweet-timestamp').css('font-size','18px');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('font-family', 'Baloo 2');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('font-size', '18px');
$('.twitter-feed').find('.twitter-timeline').contents().find('p.timeline-tweet-text').css('line-height', '1.6');
$('.twitter-feed').find('.twitter-timeline').contents().find('ul.timeline-tweet-actions').css('display', 'none');
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-Footer u-cf').css('display','block');
--------
// Call the function on dynamic updates in addition to page load
$('.twitter-feed').find('.twitter-timeline').contents().find('.timeline-TweetList').bind('DOMSubtreeModified propertychange', function () {
customizeTweetMedia(this);
});
}
</script>