Git Product home page Git Product logo

ps4-time-tracking's Introduction

ps4-time-tracking

This program helps you keep track of your PS4 gaming habits. It will create an iCalendar file which contains timespans from the time you were playing.

Requirements

The tools Python, ps4-wake and jq are needed for this process. ps4-wake will be built by running build.sh. jq for JSON parsing and Python can be obtained by your distribution.

Prerequisites

Install build-essentials (for make), pip, jq from your distribution

  1. Install Prerequisites
  2. Run build.sh
  3. Copy the resulting ps4-wake to your bin path i.e. /usr/bin
  4. Install the Python requirements with pip install -r requirements.txt.

Usage

Run ps4watch.sh in very short frequency to track what game your PS4 is running at the time. After an amount of time the log file will fill with dates:

2016-08-12T14:55+0000,null,null
2016-08-12T15:00+0000,null,null
2016-08-12T15:05+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:10+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:15+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:20+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:25+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:30+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:35+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:40+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:45+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:50+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T15:55+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T16:00+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T16:05+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T16:10+0000,"Pro Evolution Soccer 2016","CUSA02640"
2016-08-12T16:15+0000,"Destiny","CUSA00219"
2016-08-12T16:20+0000,"Destiny","CUSA00219"
2016-08-12T16:25+0000,"Destiny","CUSA00219"
2016-08-12T16:30+0000,"Destiny","CUSA00219"

You can generate calendar entries in ics format by running parseTimeSpans.py ps4watch.log calendar.ics.

Run ps4ical.sh to calculate time-spans and to generate an ics file out of it. Adapt it to your needs. Currently it contains a statement for FTP uploading to my server.

makeScore.sh is also a utilty custom made for my needs, which will generate a top 10 list of my top games and will notify me whenever a different game enters or moves up the top 10.

If you're subscribing to this calendar, you will get a nice output:

Output in Calendar

Additionally a file called statistics.csv is generated which summarizes all minutes that you played one particular game.

Example crontab

The following crontab setting will run ps4watch.sh every 5 minutes between 10pm till 2am and every half hour between 3 am and 9 pm.

*/5 10-23 * * * ps4watch.sh
*/5 0-2 * * * ps4watch.sh
*/30 3-9 * * * ps4watch.sh

ps4-time-tracking's People

Contributors

snipem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.