-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintWholeList.py
More file actions
26 lines (22 loc) · 798 Bytes
/
Copy pathPrintWholeList.py
File metadata and controls
26 lines (22 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from pymongo import MongoClient
def establishLocalMongo():
client = MongoClient('mongodb://localhost:27017', authSource='creatives')
db = client['creatives']
validChecksum = db['validChecksum']
return validChecksum
validChecksum = establishLocalMongo()
orgIds = set()
blockedChecksums = set()
with open("./blockedIds") as fp:
for line in fp:
orgIds.add(line.rstrip('\n'))
for creative in validChecksum.find():
orgId = creative['organizationId']
checksum = creative['checksum']
if orgId in orgIds:
blockedChecksums.add(checksum)
suspiciousChecksums = []
for checksum in blockedChecksums:
print("The following creatives have the same checksum" + checksum)
for creative in validChecksum.find({"checksum":checksum}):
print(creative)