Skip to content

Instantly share code, notes, and snippets.

@mdamien
Created March 25, 2019 14:45
Show Gist options
  • Save mdamien/833c5a20f912c1c455f71194cc8a3cf8 to your computer and use it in GitHub Desktop.
Save mdamien/833c5a20f912c1c455f71194cc8a3cf8 to your computer and use it in GitHub Desktop.
Sort twitter replies by likes
[].slice.call(document.querySelectorAll('.replies-to .stream-items:first-child .ProfileTweet-action--favorite .ProfileTweet-actionButton .ProfileTweet-actionCountForPresentation'))
.map(x => parseInt(x.textContent))
.filter(x=>x)
.sort((a, b) => b - a);
// to paste into the dev console when viewing a tweet replies
// output is the sorted list of number of likes for each reply
@alichatraei
Copy link

alichatraei commented Apr 24, 2021

I think it doesn't work. It didn't work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment