ansero_example.html

This commit is contained in:
Dan Hollinger 2020-12-09 01:33:08 +01:00
parent ed9a79145e
commit f3403507f9
1 changed files with 12 additions and 7 deletions

View File

@ -24,14 +24,14 @@ a[onclick] {
<script> <script>
// read API document // read API document
let apiurl = 'https://api.nnpaefp7pkadbxxkhz2agtbv2a4g5sgo2fbmv3i7czaua354334uqqad.onion/_/ansero.php'; let apiurl = 'https://(API)/_/ansero.php';
let favurl = 'https://api.nnpaefp7pkadbxxkhz2agtbv2a4g5sgo2fbmv3i7czaua354334uqqad.onion/_/favicon.php?f='; let favurl = 'https://(API)/_/favicon.php?f=';
let mylang = 'en-US'; let mylang = 'en-US'; // e.g. 'fr'
let hide_domain = []; // e.g. 'google.com' let hide_domain = []; // e.g. ['google.com', 'google.fr']
let hide_fqdn = []; // e.g. 'en.wikipedia.org' let hide_fqdn = []; // e.g. ['en.wikipedia.org']
let removeMITMsites = false; let removeMITMsites = false;
function searchfor(key) { function searchFor(key) {
document.getElementById('what').value = key; document.getElementById('what').value = key;
search(); search();
} }
@ -59,10 +59,15 @@ function search() {
if (r.sgst.length > 0) { if (r.sgst.length > 0) {
answer += '<span class="srch_sect">Search other: <br>'; answer += '<span class="srch_sect">Search other: <br>';
r.sgst.forEach(x => { r.sgst.forEach(x => {
answer += '[<a class="srch_link" onclick="searchfor(\'' + x + '\');return false;">' + x + '</a>]<br>'; answer += '[<a class="srch_link" onclick="searchFor(\'' + x + '\');return false;">' + x + '</a>]<br>';
}); });
answer += '</span><br><br>'; answer += '</span><br><br>';
} }
if (r.crct.length > 0) {
answer += '<span class="srch_sect">Maybe: ';
answer += '[<a class="srch_link" onclick="searchFor(\'' + r.crct[0] + '\');return false;">' + r.crct[0] + '</a>]<br>';
answer += '</span><br><br>';
}
r.res.forEach(x => { r.res.forEach(x => {
if (!hide_fqdn.includes(x.fqdn) && !hide_domain.includes(x.dom)) { if (!hide_fqdn.includes(x.fqdn) && !hide_domain.includes(x.dom)) {
answer += '<span class="srch_sect">'; answer += '<span class="srch_sect">';