initial commit
This commit is contained in:
commit
5b839e0543
174 changed files with 12261 additions and 0 deletions
30
werc/apps/duckduckgo/app.rc
Executable file
30
werc/apps/duckduckgo/app.rc
Executable file
|
@ -0,0 +1,30 @@
|
|||
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>
|
||||
<h2>using DuckDuckGo</h2>
|
||||
<form action="/_search/" method="POST">
|
||||
<label for="searchtext">Site search:</label>
|
||||
<input type="text" id="searchtext" name="q" placeholder="Search text...">
|
||||
<input type="submit" value="Search">
|
||||
</form>'
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue