Created
December 5, 2018 08:55
-
-
Save utgwkk/c4cdb8075f1747b30c5a34f47f44140f 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
#!/usr/bin/env python3 | |
import itertools | |
import sys | |
users = [x.rstrip() for x in sys.stdin.readlines()] | |
result = "(" + " OR ".join(map(lambda x: "from:" + x, users)) + " exclude:replies) OR " | |
pairs = [] | |
for (x, y) in itertools.permutations(users, 2): | |
pairs.append("(from:{} to:{})".format(x, y)) | |
result += " OR ".join(pairs) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment