Spaces:
Paused
Paused
Update app.py
Browse files65 unmodified lines66676869707172262 unmodified lines33533633733833934010 unmodified lines3513523533543553563577 unmodified lines36536636736836937037137265 unmodified lines@app.route('/', methods=['GET'])def search_page():"""Serve the initial page or process search with a left-to-right progress bar and URL validation."""query = request.args.get('query', '')page = request.args.get('page', '1')btn = request.args.get('btn', 'LLM Search')262 unmodified lines.search-result {{ margin-bottom: 28px; }}.search-result a {{ color: #1a0dab; font-size: 20px; text-decoration: none; }}.search-result a:hover {{ text-decoration: underline; }}.search-result .url {{ color: #006621; font-size: 14px; line-height: 20px; }}.search-result p {{ color: #4d5156; font-size: 14px; line-height: 22px; margin: 0; }}.pagination {{ text-align: center; margin: 40px 0; }}10 unmodified linesfrom {{ width: 0%; }}to {{ width: 100%; }}}}.broken {{ color: #d93025; }}</style><script>function showProgress() {{7 unmodified linesfor (let i = 0; i < links.length; i++) {{const url = links[i].href;try {{const response = await fetch(url, {{ method: 'HEAD', mode: 'no-cors' }});if (!response.ok && response.status !== 0) {{ // 0 indicates no-cors limitationlinks[i].textContent += ' [Broken Link]';links[i].classList.add('broken');}}65 unmodified lines66676869707172262 unmodified lines33533633733833934034110 unmodified lines3523533543553563577 unmodified lines36536636736836937037137237337437565 unmodified lines@app.route('/', methods=['GET'])def search_page():"""Serve the initial page or process search with a progress bar and URL validation."""query = request.args.get('query', '')page = request.args.get('page', '1')btn = request.args.get('btn', 'LLM Search')262 unmodified lines.search-result {{ margin-bottom: 28px; }}.search-result a {{ color: #1a0dab; font-size: 20px; text-decoration: none; }}.search-result a:hover {{ text-decoration: underline; }}.search-result a.broken {{ color: #d93025; }}.search-result .url {{ color: #006621; font-size: 14px; line-height: 20px; }}.search-result p {{ color: #4d5156; font-size: 14px; line-height: 22px; margin: 0; }}.pagination {{ text-align: center; margin: 40px 0; }}10 unmodified linesfrom {{ width: 0%; }}to {{ width: 100%; }}}}</style><script>function showProgress() {{7 unmodified linesfor (let i = 0; i < links.length; i++) {{const url = links[i].href;try {{const controller = new AbortController();const timeoutId = setTimeout(() => controller.abort(), 5000); // 5s timeoutconst response = await fetch(url, {{ method: 'HEAD', signal: controller.signal }});clearTimeout(timeoutId);if (!response.ok) {{links[i].textContent += ' [Broken Link]';links[i].classList.add('broken');}}
app.py+7-4