apps: rename 'search' to 'duckduckgo'
just in case we want to bring in a 'real' search app like e.g. the one in wercchan, for which see https://github.com/kfarwell/werchan/tree/master/apps/search
This commit is contained in:
parent
930d4eb9f8
commit
463eaa384e
3 changed files with 7 additions and 7 deletions
29
apps/duckduckgo/app.rc
Executable file
29
apps/duckduckgo/app.rc
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
fn conf_enable_duckduckgo {
|
||||
enable_duckduckgo=yes
|
||||
conf_enable_app duckduckgo
|
||||
pageTitle='Site Search'
|
||||
}
|
||||
|
||||
|
||||
fn duckduckgo_init {
|
||||
get_post_args q
|
||||
if (! ~ $#q 0) {
|
||||
redirect_string = 'https://duckduckgo.com/?q=site:'$SERVER_NAME^'+'^$"q
|
||||
http_redirect $redirect_string '302 Found'
|
||||
}
|
||||
if not {
|
||||
handler_body_main='duckduckgo_body'
|
||||
}
|
||||
}
|
||||
|
||||
fn duckduckgo_body {
|
||||
echo '
|
||||
<h1>Site search</h1>
|
||||
<h3>using DuckDuckGo</h3>
|
||||
<form action="/_search/" method="POST">
|
||||
<input type="text" name="q" placeholder="Search text...">
|
||||
<input type="submit" value="Search">
|
||||
</form>'
|
||||
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue