LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2015, 01:29 AM   #1
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,732
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
How to build a software which records time spent on each website?


I wish to build a software in Qt (on Linux) which tracks
the time I spend on all websites.

I need to know what is the way in Qt to grab the URL
from the currently active browser.
 
Old 03-20-2015, 01:46 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
I would say that is not possible, but probably you can give us better description of your requirements.
What do you mean by "spend time on a website"?
 
Old 03-20-2015, 01:55 AM   #3
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,732

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by pan64 View Post
What do you mean by "spend time on a website"?
For example if I spend some time browsing a particular
website, I need to know when I started it and for how much
did I browse it.

This software will be helpful to me to remind me to work
when I should rather than refreshing stackoverflow or LQ.

What would be the way to make it possible then?
What other language or environment or library do I need to make it possible?

Last edited by Aquarius_Girl; 03-20-2015 at 01:59 AM.
 
Old 03-20-2015, 02:00 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
and how can you specify it? (I mean for example how do you know you started/finished browsing LQ)? If it handled by the browser itself you need to add something like a plugin to detect those activities.
 
1 members found this post helpful.
Old 03-20-2015, 02:03 AM   #5
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,732

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by pan64 View Post
(I mean for example how do you know you started/finished browsing LQ)?
I want that to be the software's job to find that out.
Quote:
Originally Posted by pan64 View Post
If it handled by the browser itself you need to add something like a plugin to detect those activities.
Okay, so now I need to find out how to write a plugin for
firefox and chrome.
 
Old 03-20-2015, 02:33 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
no, I think you misunderstood. You need to specify the action (of the human being) to observe (by the software).
 
1 members found this post helpful.
Old 03-20-2015, 02:47 AM   #7
firstfire
Member
 
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 709

Rep: Reputation: 428Reputation: 428Reputation: 428Reputation: 428Reputation: 428
Hi.

This looks like the job for a browser plugin. If you are familiar with javascript it is relatively easy to write pligins for firefox, and chrome. The plugin should probably record when you opened particular url (or tab) and when closed/navigated from it and notify you if you spent too much time on the site.

Good luck.
 
1 members found this post helpful.
Old 03-20-2015, 03:41 AM   #8
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,732

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by pan64 View Post
no, I think you misunderstood. You need to specify the action (of the human being) to observe (by the software).
Okay, well, I'd say the software can observe the following
condition:

* A website is open and the browser is in the foreground.

I'll make sure to minimize the browser when I am not at the
computer.

@firstfire
Thankful for the useful links.
 
Old 03-20-2015, 09:19 AM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
I think the fact that you see a need to write software to monitor your computer internet use should tell you something for starters. Besides the fact that you'd be writing this software once again, instead of working?

I think the idea of writing plug-ins is probably the key, but I really have no experience to contribute there. Just really the thought processes that there are two or more types of web use. Work related, personal related, but also personal related - expected + normal, versus personal related - not normal. For instance, someone goes online to pay a bill or two, does so in about 2 minutes and that's what they do. Or they rapidly scan the weather, traffic, major news; that all seems normal for probably a desk person and their day. If someone is on social media and on there a lot as part of their day. Having a widget to monitor their time and warn them is potentially good. It all brings me back to the awareness that time is being expended incorrectly, there is internal knowledge of it, consider a non-technical method to gauge and control this instead?
 
1 members found this post helpful.
Old 03-20-2015, 09:24 AM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Do you really need to write your own?

A program to log how much time you spend in what program

Last edited by dugan; 03-20-2015 at 12:05 PM. Reason: fixed link
 
Old 03-20-2015, 09:27 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Looks like there are several firefox plugin timers. Have you searched for any yet?
Have no idea how wel or if any work but here is one:

https://addons.mozilla.org/en-us/fir...mind-the-time/
 
1 members found this post helpful.
Old 03-20-2015, 10:09 AM   #12
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,732

Original Poster
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by dugan View Post
Do you really need to write your own?

http://softwarerecs.stackexchange.com/q/696
That link doesn't work for me, says: This webpage is not available.

Quote:
Originally Posted by michaelk View Post
Looks like there are several firefox plugin timers. Have you searched for any yet?
Have no idea how wel or if any work but here is one:
https://addons.mozilla.org/en-us/fir...mind-the-time/
Thanks, I'll take a look.

Quote:
Originally Posted by rtmistler View Post
It all brings me back to the awareness that time is being expended incorrectly, there is internal knowledge of it, consider a non-technical method to gauge and control this instead?
Well, as you know, I am recovering from my depression on my own. It will take some
time to get rid of the self destructive habits.
BTW, I initially thought of writing this in Qt which I use for my
office work. I thought that'd be a nice project for my part time.
 
Old 03-20-2015, 10:20 AM   #13
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by TheIndependentAquarius View Post
That link doesn't work for me, says: This webpage is not available.
It didn't work for me either, but I was able to select/copy/paste the link text as posted in their reply into the goto location part of my browser and that does work. Also just worked in checking your quoted copy. I think you may see what I see, click -> no result. So you can select that text, copy it, and paste it into your location bar for a new tab or window on your browser and that gets you to their reference.
Quote:
Originally Posted by TheIndependentAquarius View Post
Well, as you know, I am recovering from my depression on my own. It will take some
time to get rid of the self destructive habits.
BTW, I initially thought of writing this in Qt which I use for my
office work. I thought that'd be a nice project for my part time.
Yes with some parallel thread knowledge I do realize this. Just be aware of some things, which I think you are:
  1. Tools such as this help to retain proof of non-work habits ...
  2. Persons and company members may be compassionate, in both appearance as well as sincerity and be very supportive. However when "push becomes shove", no one remains your "friend", and especially the corporate side where their best interests are to protect the integrity of their company
I think Qt is an excellent choice for UI programming. Yet again, unsure if browser plug-ins are something which Qt works well to produce. That's my lack of any plug-in experience talking. And I think the suggestions of plug-ins offered may be helpful in doing some self-research.
 
Old 03-20-2015, 12:05 PM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Quote:
Originally Posted by TheIndependentAquarius View Post
That link doesn't work for me, says: This webpage is not available.
I've fixed it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to measure CPU time spent on a code block (with C or C++)? dillongeo Programming 3 08-01-2011 12:02 AM
What is the longest time spent without using a GUI? crypticlogic Linux - General 14 12-20-2007 09:34 AM
Time spent in workspace (Gnome) littlewood Linux - Software 0 01-27-2006 12:40 PM
Log time spent on a Linux desktop Horos23 Linux - Software 3 01-11-2006 08:02 AM
Time spent working vs tinkering sausagejohnson General 6 05-18-2004 06:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration