Last active
November 28, 2017 10:45
-
-
Save ntkog/ecdf83bb1e68a136435f13d9c97f51d4 to your computer and use it in GitHub Desktop.
One-liner : Ranking Final de las charlas de CodeMotion
This file contains 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
var talksByLikes = [].slice.call(document.querySelectorAll('.ka-td-contents')).map((talk) => ({ title : talk.querySelector('.ka-talk-title').textContent , author: talk.querySelector('.ka-username').textContent, favs : +talk.querySelector('span.ka-button-indicator').textContent, rating : +talk.querySelector('a.ka-like-link + a.ka-social-link').textContent , ratio : talk.querySelector('a.ka-like-link + a.ka-social-link').title })); | |
var currentDay = /5693168230072320/.test(window.location.href) | |
? "5649626120060928" | |
: "5693168230072320"; | |
document.querySelector(`a[data-day-id="${currentDay}"]`).click(); | |
setTimeout(function(){ | |
talksByLikes = talksByLikes.concat([].slice.call(document.querySelectorAll('.ka-td-contents')).map((talk) => ({ title : talk.querySelector('.ka-talk-title').textContent , author: talk.querySelector('.ka-username').textContent, favs : +talk.querySelector('span.ka-button-indicator').textContent, rating : +talk.querySelector('a.ka-like-link + a.ka-social-link').textContent, ratio: talk.querySelector('a.ka-like-link + a.ka-social-link').title }))); | |
console.table(talksByLikes); | |
},1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment