https://github.com/makaroni4/youtube_time_tracker
Chrome Extension that tracks time you spent on Youtube.
https://github.com/makaroni4/youtube_time_tracker
chrome-extension productivity time-tracker youtube
Last synced: 7 months ago
JSON representation
Chrome Extension that tracks time you spent on Youtube.
- Host: GitHub
- URL: https://github.com/makaroni4/youtube_time_tracker
- Owner: makaroni4
- License: mit
- Created: 2019-01-12T17:03:43.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-11-30T18:50:23.000Z (almost 3 years ago)
- Last Synced: 2024-11-01T13:35:49.815Z (12 months ago)
- Topics: chrome-extension, productivity, time-tracker, youtube
- Language: JavaScript
- Homepage: https://chrome.google.com/webstore/detail/youtube-time-tracker/gadnhdhegigkbjiebmcceodbablkdjmo
- Size: 160 KB
- Stars: 108
- Watchers: 5
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# YouTube™ Time Tracker [](https://travis-ci.org/makaroni4/youtube_time_tracker) [](https://chrome.google.com/webstore/detail/youtube-time-tracker/gadnhdhegigkbjiebmcceodbablkdjmo)
YouTube™ Time Tracker is a Chrome Extension that tracks time you spent on YouTube. It's important to notice that it uses only local [chrome.storage API](https://developer.chrome.com/apps/storage) to store data and it __**does't send data anywhere**__ :warning:.

## Stored data format
Although local chrome.storage allows us to store [up to 5 Mb of data](https://developer.chrome.com/apps/storage#property-local) extension keeps its data very simple, just JSON with 8 keys for current/previous time periods:
```js
{
"2019": 110.2, // year
"jan-2019": 110.2, // month
"2-2019": 110.2, // week (0-52)
"2019-01-13": 110.2, // today
"2018": 10294, // previous year
"dec-2018": 1248, // previous month
"1-2019": 159, // previous week
"2019-01-12": 91 // yesterday,
"time_watched": 10404.2 // total time watched,
"installed_at": "2019-01-01" // when extension was installed
}
```## Development
Use `npm install` to install needed packages (there are just a bunch: webpack, babel, jest and timekeeer for testing).
Then run `npm start` for Webpack to watch and compile JS files.
Load [extension folder](https://github.com/makaroni4/youtube_time_tracker/tree/master/extension) to [chrome://extensions/](chrome://extensions/) via "Load unpacked":
.
:warning: You'll need to update extension every time you changed CSS/JS files. :warning: Webpack will watch JS files and compile app.js file in `extension` folder.
## Testing
To run tests use `npm test`.
Tests are written with [jest](https://jestjs.io/) with [a bunch of custom matchers](https://github.com/makaroni4/youtube_time_tracker/tree/master/test/custom_matchers) and [custom helper functions](https://github.com/makaroni4/youtube_time_tracker/tree/master/test/support).