Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,21 +14,22 @@ This tool connects to the LOC API, retrieves metadata from a selected collection
|
|
| 14 |
an analysis of metadata completeness, suggests enhancements, and identifies authority gaps.
|
| 15 |
""")
|
| 16 |
|
|
|
|
| 17 |
# Updated collection URLs using the correct LOC API format
|
| 18 |
collections = {
|
| 19 |
-
"American Revolutionary War Maps":
|
| 20 |
-
"Civil War Maps":
|
| 21 |
-
"Women's Suffrage":
|
| 22 |
-
"World War I Posters":
|
| 23 |
}
|
| 24 |
|
| 25 |
# Sidebar for selecting collection
|
| 26 |
st.sidebar.markdown("## Settings")
|
| 27 |
selected = st.sidebar.selectbox("Select a collection", list(collections.keys()))
|
| 28 |
-
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
collection_url = f"https://www.loc.gov/
|
| 32 |
st.sidebar.write(f"Selected Collection: {selected}")
|
| 33 |
st.sidebar.write(f"API URL: {collection_url}")
|
| 34 |
|
|
|
|
| 14 |
an analysis of metadata completeness, suggests enhancements, and identifies authority gaps.
|
| 15 |
""")
|
| 16 |
|
| 17 |
+
# Updated collection URLs using the correct LOC API format
|
| 18 |
# Updated collection URLs using the correct LOC API format
|
| 19 |
collections = {
|
| 20 |
+
"American Revolutionary War Maps": "american+revolutionary+war+maps",
|
| 21 |
+
"Civil War Maps": "civil+war+maps",
|
| 22 |
+
"Women's Suffrage": "women+suffrage",
|
| 23 |
+
"World War I Posters": "world+war+posters"
|
| 24 |
}
|
| 25 |
|
| 26 |
# Sidebar for selecting collection
|
| 27 |
st.sidebar.markdown("## Settings")
|
| 28 |
selected = st.sidebar.selectbox("Select a collection", list(collections.keys()))
|
| 29 |
+
search_query = collections[selected]
|
| 30 |
|
| 31 |
+
# Use the main search endpoint (most reliable)
|
| 32 |
+
collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
|
| 33 |
st.sidebar.write(f"Selected Collection: {selected}")
|
| 34 |
st.sidebar.write(f"API URL: {collection_url}")
|
| 35 |
|