Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
from deliverable2 import URLValidator
|
2 |
import os
|
3 |
import json
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Retrieve API key from environment variables
|
6 |
SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")
|
@@ -53,4 +57,4 @@ for query, url in zip(queries, urls):
|
|
53 |
})
|
54 |
|
55 |
# Print formatted output
|
56 |
-
print(json.dumps(results, indent=2))
|
|
|
1 |
from deliverable2 import URLValidator
|
2 |
import os
|
3 |
import json
|
4 |
+
from dotenv import load_dotenv
|
5 |
+
|
6 |
+
# Load environment variables from a .env file (if present)
|
7 |
+
load_dotenv()
|
8 |
|
9 |
# Retrieve API key from environment variables
|
10 |
SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")
|
|
|
57 |
})
|
58 |
|
59 |
# Print formatted output
|
60 |
+
print(json.dumps(results, indent=2))
|