Skip to content

Instantly share code, notes, and snippets.

@mraerino
Last active May 10, 2017 19:17
Show Gist options
  • Save mraerino/f43e5b0e34de7d88e74cccfe40d84ff9 to your computer and use it in GitHub Desktop.
Save mraerino/f43e5b0e34de7d88e74cccfe40d84ff9 to your computer and use it in GitHub Desktop.
Yotilo data extraction
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