Created
May 5, 2018 11:32
-
-
Save walaura/5ba06ceacaef43f28c678c9ce9c60c40 to your computer and use it in GitHub Desktop.
Get Twitter stats as TSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
scroll aaaall the way down in https://analytics.twitter.com/ | |
then run this in the devtools. you can paste the data straight | |
into google sheets | |
*/ | |
copy([...document.querySelectorAll('.DataPoint-info.metric-tweetviews')].map(_=> | |
_.closest('.home-group-row').querySelector('.home-group-header').innerText.replace(' SUMMARY','') | |
+"\t"+ | |
_.innerText.replace(',','').replace(/\.([0-9][0-9])K/,'$10').replace(/\.([0-9])K/,'$100').replace(/\.([0-9][0-9])M/,'$10000').replace(/\.([0-9])M/,'$100000').replace('K','000').replace('M','000000') | |
).concat(['time'+"\t"+'engagement']).reverse().join("\n")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment