Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,22 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
-
import pandas as pd
|
4 |
-
|
5 |
-
|
6 |
-
link = "https://www.oggusto.com/gastronomi/turkiye/destek-olabileceginiz-yerel-ureticiler"
|
7 |
-
|
8 |
|
9 |
def parse(link):
|
10 |
page = metadata_parser.MetadataParser(url=link)
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import metadata_parse
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def parse(link):
|
5 |
page = metadata_parser.MetadataParser(url=link)
|
6 |
+
title = page.get_metadatas('title')[0]
|
7 |
+
description = page.get_metadatas('description')[0]
|
8 |
+
image = page.get_metadata_link('image')
|
9 |
+
metadata = page.metadata
|
10 |
+
return title, description, image, metadata
|
11 |
+
|
12 |
+
with gr.Blocks() as demo:
|
13 |
+
link = gr.Textbox(label="Bağlantı")
|
14 |
+
output1 = gr.Textbox( label="Başlık")
|
15 |
+
output2 = gr.Textbox(label="Açıklama")
|
16 |
+
output3 = gr.Textbox(label="Görsel")
|
17 |
+
output4 = gr.Textbox(label="Metadata")
|
18 |
+
|
19 |
+
greet_btn = gr.Button("Gönder")
|
20 |
+
greet_btn.click(fn=parse, inputs=link, outputs=[output1,output2, output3, output4])
|
21 |
+
|
22 |
+
demo.launch()
|