[Feature Req] Expose stats via command line

Hi there,

Feature Request
Expose the geek window counts on the command line via switches in the binary

Integration with existing information display applications, such as Geektool (Mac OS X) and Conky (Linux).

Example execution
$ ./whatpulse --getstat LocalKeys
LocalKeys: 1083
$ ./whatpulse --getstat LocalKeys,TotalKeys
LocalKeys 1083
TotalKeys 39935764

Other thoughts
This basic form, or even a more basic form is all the information a Mac/Linux user would need to awk out what they want and throw it into Geektool.

Edit: Er … Alternatively I can just hit your Web API with a little NodeJS script.

I found out that exists a few seconds ago. I’m going to leave this post here though, just because, y’know, hitting your API every few seconds for Conky sounds like a load you guys don’t want. ;]

Have a look at the open sqlite database the client uses. It’s a bit of an underlit feature because I’m still working on some examples for developers, but the tables ‘settings’ and ‘unpulsed_stats’ will be of interest for you.

Also, querying the API is pretty useless, as 1) it has an hourly cache and 2) it only changes when you pulse.

Ahh, very nice. Will (ab)use this for my needs. Thanks :]

I’m trying to open whatpulse.db in ~/.local/share/data/WhatPulse/ but it is apparently either encrypted or not a database. I can, however, open whatpulse.db.backup. Is this intentional? If so, how are we supposed to access the database? I understand you probably don’t want us to fake stats, but the way you said “Have a look at the open sqlite database the client uses” makes me think I’m missing something and I should be able to get current stats from the database.

It’s not encrypted and you should be able to open it via sqlite itself just fine. Make sure you have the whatpulse.db file, not the whatpulse.wpw file.

whatpulse.wpw is the encrypted file in which the pulse stats reside. Any stats you’re going to ‘fake’ inside the whatpulse.db are local only…so if you want to have fun that way, go ahead. :wink:

Alright I got this figured out for the most part. How often does whatpulse update the whatpulse.db? I’d like to check it as often as possible, but it doesn’t seem to change more often than every 60 seconds. Can I force whatpulse to update the database more often?

Nope. That has to do with caching and database operations, which we’ve limited to spare disk operations.