forked from colin/resume
Update docker/lucky-ddg/app.py
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
48e3f5c0cb
commit
cd0092400a
|
@ -11,9 +11,8 @@ def search():
|
||||||
|
|
||||||
with DDGS() as ddgs:
|
with DDGS() as ddgs:
|
||||||
results = ddgs.text(query, max_results=1)
|
results = ddgs.text(query, max_results=1)
|
||||||
for result in results:
|
if results:
|
||||||
return redirect(result['href'])
|
return redirect(results[0]['href'])
|
||||||
|
|
||||||
return "No results found.", 404
|
return "No results found.", 404
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue