Can I track the amount of time I spend on which websites on Safari (iOS and OSX)? I would like to get something like a report of how much times I spend on which websites on a daily, weekly and monthly basis.

For example statistics like, you spend 2 hours on twitter, 3 hours on facebook, and 3 hours on google in the last week.

I would like this kind of information, because I want to get more insights in my own behaviour. 

I know there is Safari History. And I hope there are maybe applications that can analyze this history for me.

If not, could I maybe write a script that could this kind of information out of my Safari History?

I would like a solution for both iOS and OSX.
You can use the app Timing.


  Document-Based Tracking
  
  Timing automatically tracks every app, document and website you use —
  including the full file path or URL. This makes assigning time
  tracking data much easier and more accurate.


I use it to track my computer time for the purposes of billing clients.