Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
iface = gr.Interface(fn=
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import os
|
4 |
|
5 |
+
def function(paramater):
|
6 |
+
test = os.environ.get("test")
|
7 |
+
url = f"https://graph.facebook.com/v15.0/{paramater}"
|
8 |
+
payload = {
|
9 |
+
'Authorization': 'Bearer ' + test
|
10 |
+
}
|
11 |
+
response = requests.get(url, headers=payload)
|
12 |
+
response = json.loads(response.text)
|
13 |
+
image = requests.get(response["url"], headers=payload)
|
14 |
+
return image
|
15 |
|
16 |
+
iface = gr.Interface(fn=function, inputs="text", outputs="text")
|
17 |
iface.launch()
|