Skip to content

Instantly share code, notes, and snippets.

@altilunium
Created November 20, 2022 03:31
Show Gist options
  • Save altilunium/53bdb009e21de069f1a31afac557f03e to your computer and use it in GitHub Desktop.
Save altilunium/53bdb009e21de069f1a31afac557f03e to your computer and use it in GitHub Desktop.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="nyaa"></div>
</body>
<script type='text/javascript' src='tweets.js'></script>
<script>
var nyaa = nya.sort((a,b) => {
var aa = parseInt(a.tweet.favorite_count) + parseInt(a.tweet.retweet_count)
var bb = parseInt(b.tweet.favorite_count) + parseInt(b.tweet.retweet_count)
if (aa > bb){
return -1;
}
})
var theStr = "<table style='table-layout:fixed;width:900px'><tr style='font-weight:800'><td style='width:11%'>Like/RT</td><td style='width:95%;'>Tweet</td></tr>"
function blah(i) {
console.log("["+i.tweet.favorite_count+"/"+i.tweet.retweet_count+"] : "+i.tweet.full_text)
theStr = theStr + "<tr><td>" +"["+i.tweet.favorite_count+"/"+i.tweet.retweet_count+"]"+ "</td><td>" + i.tweet.full_text +"</td></tr>"
}
nyaa.forEach(blah)
theStr = theStr + "</table>"
var t = document.getElementById("nyaa")
t.innerHTML = theStr
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment