springwater commited on
Commit
0290677
·
verified ·
1 Parent(s): 51af61d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -14,29 +14,18 @@ def extract_pdf_links(url):
14
 
15
  return pdf_links[:100]
16
 
17
- def filter_links_by_keyword(pdf_links, keyword):
18
- filtered_links = [link for link in pdf_links if keyword in link]
19
- return filtered_links
20
-
21
  def generate_html(pdf_links):
22
  html = ""
23
  for link in pdf_links:
24
  html += f'<a href="{link}" target="_blank" download>{link}</a><br/>'
25
  return html
26
 
27
- def main(url, keyword):
28
- pdf_links = extract_pdf_links(url)
29
- if keyword:
30
- pdf_links = filter_links_by_keyword(pdf_links, keyword)
31
- return generate_html(pdf_links)
32
 
33
- title = "네이버 증권 리서치 링크 - https://finance.naver.com/research/company_list.naver"
34
 
35
- iface = gr.Interface(main,
36
- inputs=["text", "text"],
37
  outputs="text",
38
- title=title,
39
- inputs=["text", "text"],
40
- inputs=["URL", "키워드(선택)"])
41
 
42
- iface.launch()
 
14
 
15
  return pdf_links[:100]
16
 
 
 
 
 
17
  def generate_html(pdf_links):
18
  html = ""
19
  for link in pdf_links:
20
  html += f'<a href="{link}" target="_blank" download>{link}</a><br/>'
21
  return html
22
 
 
 
 
 
 
23
 
24
+ title = "네이버 증권 리서치 링크- https://finance.naver.com/research/company_list.naver"
25
 
26
+ iface = gr.Interface(extract_pdf_links,
27
+ inputs="text",
28
  outputs="text",
29
+ title=title)
 
 
30
 
31
+ iface.launch()