Last active
December 6, 2016 06:04
-
-
Save liddiard/da2ab59020c1c227ed34281ff67e40a7 to your computer and use it in GitHub Desktop.
Documenting the spread of dank memes at UCLA: https://www.facebook.com/groups/163576114113950/members/
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
// click the "more members" button programatically to get everyone who likes dank memes | |
window.setInterval(() => { document.querySelector('.uiMorePagerPrimary').click() }, 5000); | |
// get the names of everyone who likes dank memes | |
let people = Array | |
.from(document.querySelectorAll('.fsl.fwb.fcb')) | |
.map(a => { return a.innerText }); | |
// get the 100x100 profile photo URLs of everyone who likes dank memes | |
let photos = Array | |
.from(document.querySelectorAll('._s0._rv.img')) | |
.map(img => { return img.src }); | |
// get the times the dank memers were added (non-fuzzy strings) | |
let times = Array | |
.from(document.querySelectorAll('._51mx .fsm.fwn.fcg abbr')) | |
.map(abbr => { return abbr.title }); | |
// bundle it all together in an array of objects | |
let objects = people | |
.map((person, index) => { | |
return { name: person, photo: photos[index], time: times[index] } | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment