Created
August 16, 2013 22:13
-
-
Save sente/6253933 to your computer and use it in GitHub Desktop.
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 events import events | |
import pprint | |
import operator | |
import collections | |
import datetime | |
secs = 24*60*60*15 | |
now = int(datetime.datetime.now().strftime("%s")) | |
first_epoch = now - secs | |
last_15 = list(events.find({'epochtime': {'$gt': first_epoch}})) | |
lists = [frozenset(l.keys()) for l in last_15] | |
most_common = collections.Counter(lists) | |
sorted_x = sorted(most_common.iteritems(), key=operator.itemgetter(1)) | |
for num, ourset in sorted_x: | |
print num | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment