Skip to content

Instantly share code, notes, and snippets.

@methane
Created June 29, 2012 07:51
Show Gist options
  • Select an option

  • Save methane/3016545 to your computer and use it in GitHub Desktop.

Select an option

Save methane/3016545 to your computer and use it in GitHub Desktop.
import bz2
import re
import sys
R = re.compile('opensocial_viewer_id=(\w+)')
def count_uu(fn):
f = bz2.BZ2File(fn)
acc = set()
for L in f:
m = R.search(L)
if m:
acc.add(m.group(1))
return len(acc)
print count_uu(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment