aardappel / procrastitracker

a Windows time tracking application
http://strlen.com/procrastitracker/
500 stars 53 forks source link

Feature Requests - Is there a way to get the URL of the tabs aswell (especially for chrome)? #8

Open pateldhruv1993 opened 8 years ago

pateldhruv1993 commented 8 years ago

So I'm collecting data on myself and I like that your app records each and every window even sub windows.. But is there a way for you to collect data on the URL of the web and/or file location of an application?

Also the exact date and time of the application start and end would be nice compared to just the total usage time..

aardappel commented 8 years ago

For any web browser including chrome, it currently already collects data by url. Simply browse the data under chrome, and you should see by url statistics.

For non-browsers, it uses the window title. Most editors (e.g. Notepad++, Word, Visual Studio etc.) show the document or project path in the window title, and will thus be tracked.

pateldhruv1993 commented 8 years ago

I think you misunderstood me. I know you get information on every single tab of chrome including the window title and time spent on that tab like this: Image

What I'm requesting is something like this: "www.github.com/pateldhruv1993/settings/"

Getting the actual URL and not just the title of the page. Because I couldn't find that information in the HTML data dump or in the app itself.

Also is there a way to get the exact time and date when the app started and ended rather than just the total value of time spent on an app. I know it hard to show that all in UI but you could only have that info in the exported data and not show that advanced stuff in UI.

This will help in getting stats and figuring out what app you're most likely to use during certain time of the day or week

aardappel commented 8 years ago

Interesting.. the URL used to work: if I look at my all time data under chrome, it's all "google.com" etc. But if I select last week, I get only window titles. It also doesn't work with FireFox. This functionality uses "DDE" to retrieve this information from browsers, and it must have broken somewhere along the way.

As for app start, yes, it actually records the first time any item collected time for each day, but currently that information goes unused. I could potentially show that in the hover-over popup.

aardappel commented 8 years ago

It succeeds on IE. Not sure if it ever worked on chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=70184

aardappel commented 8 years ago

Ok, added special-purpose code for chrome that gets the url in a different way: https://github.com/aardappel/procrastitracker/commit/8e30bed248a8cf745c5fd8dad94b3d64cb03e212

You still might not like it fully, since this only shows the domain, not the rest of the url. This has been the behavior for urls for all browsers in the past, and it is because a lot of urls end up putting a lot of random spam into the database. I kept that behavior for consistency.

I also added a start time display, which is the start time for any item on the last day it was used. It is only shown for leaf items, not the app/site as a whole. This is the best I could do for now. It's shown both in the tool-tip and the html output.

pateldhruv1993 commented 8 years ago

Sweet! Thanks for the updates!

And about the start time of apps and stuff, the new data in export files should be more than enough. I wanted to scrap the HTML export regularly and so finding out the approximate start and end time off of that should be easy.

ultrasemen commented 5 years ago

Still doesn't work for me, neither in Chrome nor Firefox.

aardappel commented 5 years ago

@ultrasemen You just get window titles? What version of Chrome/Firefox?

ultrasemen commented 5 years ago

@aardappel yes. Latest, I think? 74.0.3729.157 64-bit chrome, 66.0.3 64-bit firefox. Actually I just updated firefox to latest (66.0.5) and also restarted PC just in case. No luck. (I have Windows 10 64-bit) Maybe I am just doing something wrong? Maybe there is some kind of switch that toggles domain names, but I couldnt find it. Or maybe I need to install some browser extension?

aardappel commented 5 years ago

On Chrome Version 74.0.3729.131 (Official Build) (64-bit) here, and Firefox 66.0.2 (64-bit).

I get domains on Chrome but not on Firefox. I'll see if I can debug with Firefox. Not sure why Chrome doesn't work for you.

aardappel commented 5 years ago

Ok, seems Firefox also broke this functionality on purpose: https://bugzilla.mozilla.org/show_bug.cgi?id=1373212 Not sure if there's a workaround.

aardappel commented 5 years ago

Made some attempts at seeing if there's a way to fix it, but nothing so far: https://github.com/aardappel/procrastitracker/commit/13535485bcac21a254520282554bf78e31637dc1

ultrasemen commented 5 years ago

Other trackers I tried (like Motivate Clock) claim to solve this by using browser extensions. Although in their case it didnt work for me as well.

aardappel commented 5 years ago

Yes, not about to create a browser extension :)