awacke1 commited on
Commit
f5fe882
·
verified ·
1 Parent(s): 9370ac7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -627,9 +627,23 @@ def display_images_and_wikipedia_summaries():
627
  with cols[col_index % current_grid_size]:
628
  image = Image.open(image_file)
629
  st.image(image, caption=image_file, use_column_width=True)
630
- # Display of links or other information follows here
631
 
632
- col_index += 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
633
 
634
  def display_images_and_wikipedia_summaries_deprecated():
635
  image_files = [f for f in os.listdir('.') if f.endswith('.png')]
 
627
  with cols[col_index % current_grid_size]:
628
  image = Image.open(image_file)
629
  st.image(image, caption=image_file, use_column_width=True)
 
630
 
631
+ # Display Wikipedia and Google search links
632
+ keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
633
+ wikipedia_url = create_search_url_wikipedia(keyword)
634
+ google_url = create_search_url_google(keyword)
635
+ youtube_url = create_search_url_youtube(keyword)
636
+ bing_url = create_search_url_bing(keyword)
637
+ ai_url = create_search_url_ai(keyword)
638
+ links_md = f"""
639
+ [Wikipedia]({wikipedia_url}) |
640
+ [Google]({google_url}) |
641
+ [YouTube]({youtube_url}) |
642
+ [Bing]({bing_url}) |
643
+ [AI]({ai_url})
644
+ """
645
+ st.markdown(links_md)
646
+ col_index += 1
647
 
648
  def display_images_and_wikipedia_summaries_deprecated():
649
  image_files = [f for f in os.listdir('.') if f.endswith('.png')]