Last active
March 12, 2016 08:48
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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