Last active
May 10, 2017 19:17
-
-
Save mraerino/f43e5b0e34de7d88e74cccfe40d84ff9 to your computer and use it in GitHub Desktop.
Yotilo data extraction
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
const data = document.getElementsByTagName('days-list')[0].days | |
.map(day => ({ day: (new Date(day)).toLocaleDateString(), items: JSON.parse(localStorage.getItem('day-'+day)) })) | |
.filter(e => e.items.length > 0) | |
.reduce((sum,e) => | |
sum.concat(e.items.map(i => Object.assign({}, i, { day: e.day }))), | |
[]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment