Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -55,22 +55,12 @@ def is_recent_news(time_str):
|
|
55 |
|
56 |
time_str = time_str.lower().strip()
|
57 |
|
58 |
-
|
59 |
-
|
60 |
|
61 |
-
if "
|
62 |
-
|
63 |
-
result = days <= 1
|
64 |
-
print(f"Days ago: {days}, Result: {result}")
|
65 |
-
return result
|
66 |
|
67 |
-
if "hour ago" in time_str or "hours ago" in time_str:
|
68 |
-
hours = int(re.findall(r'\d+', time_str)[0])
|
69 |
-
result = hours <= 24
|
70 |
-
print(f"Hours ago: {hours}, Result: {result}")
|
71 |
-
return result
|
72 |
-
|
73 |
-
print(f"No match found for: {time_str}")
|
74 |
return False
|
75 |
|
76 |
def format_results(results):
|
|
|
55 |
|
56 |
time_str = time_str.lower().strip()
|
57 |
|
58 |
+
if "1 day ago" in time_str:
|
59 |
+
return True
|
60 |
|
61 |
+
if "hours ago" in time_str:
|
62 |
+
return True
|
|
|
|
|
|
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
return False
|
65 |
|
66 |
def format_results(results):
|