Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ api_login = st.sidebar.text_input("API Login", value="[email protected]
|
|
74 |
api_key = st.sidebar.text_input("API Key", type="password")
|
75 |
|
76 |
# Filters input
|
77 |
-
|
78 |
is_lost = st.sidebar.checkbox("Is Lost", value=False)
|
79 |
dofollow = st.sidebar.checkbox("Dofollow", value=True)
|
80 |
backlink_spam_score = st.sidebar.slider("Backlink Spam Score ≤", 0, 100, 10)
|
@@ -84,18 +84,12 @@ is_broken = st.sidebar.checkbox("Is Broken", value=False)
|
|
84 |
# Prepare filters for API call
|
85 |
filters = []
|
86 |
|
87 |
-
if
|
88 |
-
for
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
formatted_pattern = f"%{formatted_pattern}%"
|
94 |
-
filters.append(["url_from", "not_like", formatted_pattern])
|
95 |
-
filters.append("and")
|
96 |
-
|
97 |
-
# Debugging: Print out the final filters before the API call
|
98 |
-
st.text(f"Final Filters: {filters}")
|
99 |
|
100 |
if is_lost:
|
101 |
filters.append(["is_lost", "=", is_lost])
|
|
|
74 |
api_key = st.sidebar.text_input("API Key", type="password")
|
75 |
|
76 |
# Filters input
|
77 |
+
url_from_exclusions = st.sidebar.text_area("Exclude URLs containing (newline-separated)")
|
78 |
is_lost = st.sidebar.checkbox("Is Lost", value=False)
|
79 |
dofollow = st.sidebar.checkbox("Dofollow", value=True)
|
80 |
backlink_spam_score = st.sidebar.slider("Backlink Spam Score ≤", 0, 100, 10)
|
|
|
84 |
# Prepare filters for API call
|
85 |
filters = []
|
86 |
|
87 |
+
if url_from_exclusions:
|
88 |
+
exclusion_list = [exclusion.strip() for exclusion in re.split('[,\n]+', url_from_exclusions)]
|
89 |
+
for idx, url in enumerate(exclusion_list):
|
90 |
+
filters.append(["url_from", "not_like", url])
|
91 |
+
if idx < len(exclusion_list) - 1:
|
92 |
+
filters.append("or")
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
if is_lost:
|
95 |
filters.append(["is_lost", "=", is_lost])
|