-
-
Save cmlh/f2f316dcc48e36ae5c2d6dc0ad01cd0d to your computer and use it in GitHub Desktop.
Hack to allow us to load icon images in Maltego by following the redirect and serving up the actual image.
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/env/python | |
# -*- coding: utf-8 -*- | |
# Hack to allow us to load icon images in Maltego by following | |
# the redirect and serving up the actual image. | |
from flask import Flask, send_file | |
import requests | |
app = Flask(__name__) | |
@app.route('/fb/pic/<id>') | |
def getPicURL(id): | |
"Pass Facebook ID, get profile photo" | |
r = requests.get("https://graph.facebook.com/%s/picture" % id) | |
url = r.url | |
response = requests.get(url, stream=True) | |
return send_file(response.raw, mimetype='image/gif') | |
return response.raw | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment