To keep searx small, we can extend plugin features.
Directory structure:
__init__.py
static # directory for the static files
templates # directory for the jinja2 templates
The template directory allow to add new template results.
#!/usr/bin/env python | |
""" | |
Send one query to to one engine: | |
* load one engine using the YAML configuration in the ENGINE_SETTINGS_YAML variable. | |
* get query from the first command line argument. | |
* get the other parameters from the SEARCH_QUERY variable. | |
* JSON output. | |
This script intents to help engine developments and is designed to be hacked in the "Parameters" section. |
import os | |
import io | |
import re | |
import csv | |
import requests | |
DOCTOLIB_HEADERS = { | |
'X-Covid-Tracker-Key': os.environ.get('DOCTOLIB_APIKEY', None) | |
} |
To keep searx small, we can extend plugin features.
Directory structure:
__init__.py
static # directory for the static files
templates # directory for the jinja2 templates
The template directory allow to add new template results.
from abc import abstractmethod | |
from lxml import html | |
from searx.utils import extract_text, get_xpath | |
class XPathDSL: | |
@abstractmethod | |
def __rrshift__(self, other): |
SELECT ?item ?itemLabel ?itemDescription ?lat ?long ?P571 ?P571timePrecision ?P571timeZone ?P571timeCalendar ?P576 ?P576timePrecision ?P576timeZone ?P576timeCalendar ?P580 ?P580timePrecision ?P580timeZone ?P580timeCalendar ?P582 ?P582timePrecision ?P582timeZone ?P582timeCalendar ?P569 ?P569timePrecision ?P569timeZone ?P569timeCalendar ?P570 ?P570timePrecision ?P570timeZone ?P570timeCalendar ?P619 ?P619timePrecision ?P619timeZone ?P619timeCalendar ?P620 ?P620timePrecision ?P620timeZone ?P620timeCalendar (group_concat(distinct ?P27Label;separator=", ") as ?P27Labels) (group_concat(distinct ?P495Label;separator=", ") as ?P495Labels) (group_concat(distinct ?P17Label;separator=", ") as ?P17Labels) (group_concat(distinct ?Q180Label;separator=", ") as ?Q180Labels) (group_concat(distinct ?P36Label;separator=", ") as ?P36Labels) (group_concat(distinct ?P35Label;separator=", ") as ?P35Labels) (group_concat(distinct ?P6Label;separator=", ") as ?P6Labels) (group_concat(distinct ?P122Label;separator=", ") as ?P122Labels) |
import typing | |
from .. import model | |
from ..case import async_record_measure | |
import asyncio | |
import httpx | |
""" | |
httpx HTTP/2 |
Unclean code / prototype to replace https://github.com/asciimoo/searx/tree/master/searx/plugins/https_rules
git clone https://github.com/EFForg/https-everywhere
python merge.py
python lookup.py
merge.py
produces a JSON file of 2.5MB (3717 regex).
The JSON file have two Trie (in normal order www -> eff -> org, and reverse order org -> eff -> *):
*
for wildcarelocalhost
:pip install trustme-cli
trustme-cli
wrk
on each endpoint, eg:[ | |
{ | |
"name": "searx.space", | |
"filters": ["Header:X-Forwarded-For=(2001:41d0:8:de3::1|176.31.252.227)"], | |
"stop": true, | |
"actions": [{ "name": "log"}] | |
}, | |
{ | |
"name": "IP limit, all paths", | |
"interval": 3, |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |