Last active
December 12, 2024 08:22
-
-
Save FreePhoenix888/9c1a1a143ef00d4455d7ea315fc3c433 to your computer and use it in GitHub Desktop.
Export watcher data
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
// Open the watcher website and execute this command in the browser console | |
const allData = [] | |
const dayColumns = document.querySelectorAll(`.day`) | |
for (const dayColumn of dayColumns) { | |
const date = dayColumn.querySelector(`.day-header__date`) | |
const loggedTimes = dayColumn.querySelectorAll(`.logged-time`) | |
for (const loggedTime of loggedTimes) { | |
const subtitle = loggedTime.querySelector(`.logged-time-header__subtitle`).children[0] | |
const time = loggedTime.querySelector(`.logged-time-header__time`) | |
const data = {date: date.textContent, time: time.textContent, description: subtitle.textContent} | |
allData.push(data) | |
} | |
} | |
// You can log json itself instead of this text. I have mapped it to have less text | |
console.log(allData.map(data => `${data.date}|${data.time}|${data.description}`).join(`\n`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment