Created
June 21, 2016 14:17
-
-
Save vpack/e2156a16aab29be4f2dd4ba2d2618565 to your computer and use it in GitHub Desktop.
Facebook API : threat_indicators
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 requests | |
import json | |
url = "https://graph.facebook.com/v2.4/threat_indicators" | |
params = { | |
"type": "IP_ADDRESS", | |
"text": "proxy", | |
"access_token": "XXXX|YYYY", | |
"limit": "1000", | |
"after": "dummy" | |
} | |
while params["after"]: | |
r = requests.get(url, params=params) | |
data = r.json()["data"] | |
for itm in data: print itm["indicator"] | |
params["after"] = r.json()["paging"]["cursors"]["after"] if r.json().get("paging") is not None else None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment