prointerv commited on
Commit
3c0d8df
ยท
verified ยท
1 Parent(s): ada2a95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -15
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import requests
3
  from bs4 import BeautifulSoup
4
 
5
- # ๐Ÿ”น Epic Games
6
  def get_epic_free_games():
7
  try:
8
  url = "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?locale=en-US"
@@ -24,7 +24,7 @@ def get_epic_free_games():
24
  except Exception as e:
25
  return [f"โŒ Error fetching Epic Games: {e}"]
26
 
27
- # ๐Ÿ”น Steam Games with images
28
  def get_steam_games():
29
  try:
30
  url = "https://isthereanydeal.com/giveaways/"
@@ -54,7 +54,7 @@ def get_steam_games():
54
  except Exception as e:
55
  return [], [f"โŒ Steam error: {e}"]
56
 
57
- # ๐Ÿ”น Main function
58
  def generate_free_game_data():
59
  epic = get_epic_free_games()
60
  steam_imgs, steam_info = get_steam_games()
@@ -69,22 +69,31 @@ def generate_free_game_data():
69
 
70
  return steam_imgs, full_text, "free_games.txt"
71
 
72
- # ๐Ÿ”น UI Layout
73
- with gr.Blocks(theme=gr.themes.Soft()) as demo:
74
- gr.Markdown("""
75
- # ๐Ÿ•น๏ธ **Free Game Radar**
76
- Discover limited-time free games every day!
77
- โœ… Epic Games
78
- โœ… Steam giveaways
79
- Click below to start scanning ๐Ÿ‘‡
80
  """)
81
 
82
- btn = gr.Button("๐Ÿš€ Check Free Games", variant="primary")
 
83
 
84
- gallery = gr.Gallery(label="๐ŸŸข Steam Game Covers", columns=2, height="auto", show_label=True)
85
- summary = gr.Textbox(label="๐Ÿ“‹ Game Summary", lines=20)
86
- file = gr.File(label="โฌ‡๏ธ Download Game List (.txt)")
 
 
 
87
 
88
  btn.click(fn=generate_free_game_data, inputs=[], outputs=[gallery, summary, file])
89
 
 
 
 
 
 
 
90
  demo.launch()
 
2
  import requests
3
  from bs4 import BeautifulSoup
4
 
5
+ # Epic Games
6
  def get_epic_free_games():
7
  try:
8
  url = "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?locale=en-US"
 
24
  except Exception as e:
25
  return [f"โŒ Error fetching Epic Games: {e}"]
26
 
27
+ # Steam Games
28
  def get_steam_games():
29
  try:
30
  url = "https://isthereanydeal.com/giveaways/"
 
54
  except Exception as e:
55
  return [], [f"โŒ Steam error: {e}"]
56
 
57
+ # Combined Function
58
  def generate_free_game_data():
59
  epic = get_epic_free_games()
60
  steam_imgs, steam_info = get_steam_games()
 
69
 
70
  return steam_imgs, full_text, "free_games.txt"
71
 
72
+ # Gradio App
73
+ with gr.Blocks(theme=gr.themes.Soft(primary_hue="purple")) as demo:
74
+ gr.HTML("""
75
+ <div style="text-align: center; padding: 2rem 1rem;">
76
+ <h1 style="font-size: 2.5rem; margin-bottom: 0.5rem;">๐Ÿ•น๏ธ Free Game Radar</h1>
77
+ <p style="font-size: 1.1rem; color: #555;">Automatically find and display daily free games from Epic, Steam, and more.</p>
78
+ </div>
 
79
  """)
80
 
81
+ with gr.Row():
82
+ btn = gr.Button("๐ŸŽฎ Scan for Free Games", variant="primary")
83
 
84
+ with gr.Row():
85
+ gallery = gr.Gallery(label="๐ŸŸข Steam Game Covers", columns=2, height="auto", show_label=True)
86
+
87
+ summary = gr.Textbox(label="๐Ÿ“‹ Game Summary", lines=20, interactive=False)
88
+
89
+ file = gr.File(label="โฌ‡๏ธ Download Game List (.txt)", interactive=False)
90
 
91
  btn.click(fn=generate_free_game_data, inputs=[], outputs=[gallery, summary, file])
92
 
93
+ gr.HTML("""
94
+ <div style="text-align: center; font-size: 0.9rem; color: #777; padding: 2rem 0;">
95
+ Made with ๐Ÿ’ป by [Your Name] โ€ข Powered by Python & Hugging Face
96
+ </div>
97
+ """)
98
+
99
  demo.launch()