Skip to content

Instantly share code, notes, and snippets.

@ntkog
Last active November 28, 2017 10:45
Show Gist options
  • Save ntkog/ecdf83bb1e68a136435f13d9c97f51d4 to your computer and use it in GitHub Desktop.
Save ntkog/ecdf83bb1e68a136435f13d9c97f51d4 to your computer and use it in GitHub Desktop.
One-liner : Ranking Final de las charlas de CodeMotion
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