Update app.py
Browse files
app.py
CHANGED
@@ -80,6 +80,12 @@ dofollow = st.sidebar.checkbox("Dofollow", value=True)
|
|
80 |
backlink_spam_score = st.sidebar.slider("Backlink Spam Score ≤", 0, 100, 10)
|
81 |
page_from_language = st.sidebar.selectbox("Page From Language", ['en', 'other'])
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
# Prepare filters for API call
|
84 |
filters = []
|
85 |
|
@@ -100,6 +106,25 @@ filters.append(["backlink_spam_score", "<=", backlink_spam_score])
|
|
100 |
filters.append("and")
|
101 |
filters.append(["page_from_language", "=", page_from_language])
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
# Remove the last "and" if it's the last element
|
104 |
if filters and filters[-1] == "and":
|
105 |
filters.pop()
|
@@ -128,8 +153,8 @@ if generate_button and target_url:
|
|
128 |
mime='text/csv',
|
129 |
)
|
130 |
else:
|
131 |
-
st.error("Failed to generate CSV: No data returned from the API or data processing error")
|
132 |
|
133 |
# Reset functionality
|
134 |
if reset_button:
|
135 |
-
st.experimental_rerun()
|
|
|
80 |
backlink_spam_score = st.sidebar.slider("Backlink Spam Score ≤", 0, 100, 10)
|
81 |
page_from_language = st.sidebar.selectbox("Page From Language", ['en', 'other'])
|
82 |
|
83 |
+
# New filters
|
84 |
+
include_subdomains = st.sidebar.checkbox("Include Subdomains", value=True)
|
85 |
+
page_from_rank = st.sidebar.text_input("Page From Rank (e.g., '<10,>1')")
|
86 |
+
domain_from_rank = st.sidebar.text_input("Domain From Rank (e.g., '<10,>1')")
|
87 |
+
is_broken = st.sidebar.checkbox("Is Broken", value=False)
|
88 |
+
|
89 |
# Prepare filters for API call
|
90 |
filters = []
|
91 |
|
|
|
106 |
filters.append("and")
|
107 |
filters.append(["page_from_language", "=", page_from_language])
|
108 |
|
109 |
+
# New filters processing
|
110 |
+
filters.append(["include_subdomains", "=", include_subdomains])
|
111 |
+
filters.append("and")
|
112 |
+
|
113 |
+
for rank_condition in page_from_rank.split(','):
|
114 |
+
if rank_condition:
|
115 |
+
operator, value = rank_condition[:1], rank_condition[1:]
|
116 |
+
filters.append(["page_from_rank", operator, value])
|
117 |
+
filters.append("and")
|
118 |
+
|
119 |
+
for rank_condition in domain_from_rank.split(','):
|
120 |
+
if rank_condition:
|
121 |
+
operator, value = rank_condition[:1], rank_condition[1:]
|
122 |
+
filters.append(["domain_from_rank", operator, value])
|
123 |
+
filters.append("and")
|
124 |
+
|
125 |
+
filters.append(["is_broken", "=", is_broken])
|
126 |
+
filters.append("and")
|
127 |
+
|
128 |
# Remove the last "and" if it's the last element
|
129 |
if filters and filters[-1] == "and":
|
130 |
filters.pop()
|
|
|
153 |
mime='text/csv',
|
154 |
)
|
155 |
else:
|
156 |
+
st.error("Failed to generate CSV: No data returned from the API or data processing error.")
|
157 |
|
158 |
# Reset functionality
|
159 |
if reset_button:
|
160 |
+
st.experimental_rerun()
|