Advertisement
Guest User

Untitled

a guest
Jul 16th, 2022
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3.  uses greasemonkey built in objects (GM_)
  4.  uses jquery
  5.  
  6. CSS:
  7. ====
  8. .WES_tweet_embed_frame {
  9.     width: 90%;
  10.     height: 500px;
  11. }
  12.  
  13. */
  14.  
  15. $( document ).ready(function(){
  16.     $( '.tweet' ).each(function() {
  17.                 var tweetId = $(this).attr("data-tweet");
  18.                 GM_addStyle('.twitter-tweet, .twitter-tweet-rendered { display: none !important; }');
  19.                 $(this).removeAttr("data-tweet").removeAttr("data-loaded");
  20.                 $(this).addClass('WES_tweet').removeClass('tweet');
  21.                 $(this).empty();
  22.                 var embedHtml = `
  23.                 <iframe id="WES_nitter_${tweetId}" class="WES_tweet_embed_frame" data-tweet="${tweetId}" loading="lazy"
  24.                 src="https://nitter.net/embed/Tweet.html?id=${tweetId}"></iframe>
  25.                 `;
  26.                 $(this).html(embedHtml);
  27.             });
  28.  
  29.             $( ".twitter-tweet-rendered" ).each(function(){
  30.                 $(this).remove();
  31.             });
  32. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement