Created
June 29, 2012 07:51
-
-
Save methane/3016545 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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