Skip to content

Instantly share code, notes, and snippets.

@ghost-not-in-the-shell
Last active June 1, 2021 23:36
Show Gist options
  • Save ghost-not-in-the-shell/826dd2ece9042f52e058ed6b2fbafdc9 to your computer and use it in GitHub Desktop.
Save ghost-not-in-the-shell/826dd2ece9042f52e058ed6b2fbafdc9 to your computer and use it in GitHub Desktop.
import requests
import json
import time
query = """query {
pooledUserCommands {
hash
}
}"""
url = 'http://localhost:3085/graphql'
while True:
time.sleep(5)
r = requests.post(url, json={'query': query})
if r.status_code != 200:
print "request failed: ", r.text
else:
data = json.loads(r.text)
hashes = set(map(lambda x: x['hash'], data['data']['pooledUserCommands']))
target_hashes = set(['CkpYSMrZ47dGY1Pu2phsn4DW4RgVUVupqva2jq2eux9RAEYRP7oTn'])
intersections = hashes & target_hashes
if len(intersections) > 0:
print intersections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment