commit 2ff52a39e335327ff1b100b77b4d96aef25cf12e from: Aleksey Ryndin date: Wed Oct 09 16:24:41 2024 UTC Add search commit - 3e30fc1ff40964a1f98ac42ab395898930878131 commit + 2ff52a39e335327ff1b100b77b4d96aef25cf12e blob - cea5f1d2a22257deeca388cba3768c50ed9aaf22 blob + 78435b93a781e48ab7c2f97cc375720b07e954b4 --- lonk.py +++ lonk.py @@ -416,6 +416,18 @@ def page_convoy(db_con, client_id, lonk_url, honk_url) print_gethonks(gethonks_answer, lonk_url, honk_url) +def page_search(db_con, client_id, lonk_url, honk_url): + if not lonk_url.query: + print("10 What are we looking for?") + + q = unquote(lonk_url.query) + gethonks_answer = honk_url.do_get("gethonks", page="search", q=q) + print("20 text/gemini\r") + print(f"# 𝓗 onk: search - {q}\r") + print("\r") + print_gethonks(gethonks_answer, lonk_url, honk_url) + + def page_atme(db_con, client_id, lonk_url, honk_url): gethonks_answer = honk_url.do_get("gethonks", page="atme") print("20 text/gemini\r") @@ -441,6 +453,7 @@ def print_gethonks(gethonks_answer, lonk_url, honk_url print(line + "\r") print(f"=> {honk_url.build_url(path='honkers')} honkers\r") + print(f"=> {lonk_url.build('search')} search\r") _menu() print("\r") @@ -561,6 +574,8 @@ def vgi(cert_hash, raw_url): authenticated(cert_hash, lonk_url, page_convoy) elif lonk_url.page == "atme": authenticated(cert_hash, lonk_url, page_atme) + elif lonk_url.page == "search": + authenticated(cert_hash, lonk_url, page_search) elif lonk_url.page == "bonk": authenticated(cert_hash, lonk_url, bonk) elif lonk_url.page == "ask_server":