Skip to content

Instantly share code, notes, and snippets.

@jaymu53
Last active March 12, 2016 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaymu53/892002c68e21aeec6e5c to your computer and use it in GitHub Desktop.
Save jaymu53/892002c68e21aeec6e5c to your computer and use it in GitHub Desktop.
Prints a count of the number of times a url has been visited. Takes plist file as input.
from biplist import *
import collections
import sys
plist = readPlist(sys.argv[1])
history = plist['WebHistoryDates']
counts = collections.defaultdict(lambda : 0)
for url in history:
counts[url['']] += url['visitCount']
for url in sorted(counts, key=counts.get, reverse=True):
print url, counts[url]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment