Skip to content

Instantly share code, notes, and snippets.

@vpack
Created June 21, 2016 14:17
Show Gist options
  • Save vpack/e2156a16aab29be4f2dd4ba2d2618565 to your computer and use it in GitHub Desktop.
Save vpack/e2156a16aab29be4f2dd4ba2d2618565 to your computer and use it in GitHub Desktop.
Facebook API : threat_indicators
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