views:

101

answers:

3

How could a (Windows) desktop application be created to monitor the amount of time spent on a particular website?

My first idea was to play with the Host file to intercept requests, log, and proxy. This feels a bit clunky; and I suspect my program would look like malware.

I feel like there is a smarter way? Any ideas?

+2  A: 

You could do this by monitoring active connections via netstat, or if you need more advanced data you can install The Windows Packet Capture Library and get any data about network use, and inside your desktop app, find network traffic that relates to 'spending time' on a website (which might just be GET requests for you, but I don't know), and record various statistics as required.

KernelJ
+3  A: 

There is a tool similar to what you are looking for called K-9 Web Protection. It is more used for parents to monitor what their kids are up to when hooked up to the internet. I have installed this for my niece's computer with good results and praises as it blocks, content filter, restrict internet times. This may be OTT for your needs but worth a shot as you can see what sites were visited.

The other, is to use a dedicated firewall monitoring solution such as IPCOP which is a Linux based distribution with a sole purpose in providing a proxy, stateful packet inspection (SPI) firewall, Intrusion Detection System (IDS).

Hope this helps, Best regards, Tom.

tommieb75
Net Nanny was another similar product
OMG Ponies
A: 

Route the traffic through a scriptable proxy and change the browser settings to point to that proxy.

jrhicks