From 01756fd3fdfbee8d6bd198a7f403cac492740033 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sat, 14 Sep 2019 16:41:02 +0100 Subject: [PATCH] Initial check-in of code --- .gitignore | 23 +++++++++++++++++++++++ .npmignore | 4 ++++ package.json | 36 ++++++++++++++++++++++++++++++++++++ src/icon.png | Bin 0 -> 1853 bytes src/index.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 package.json create mode 100644 src/icon.png create mode 100644 src/index.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5aa5ccc --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules + +# testing +/coverage + +# production +/dist + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +yarn.lock diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..b14796c --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +src +node_modules +screenshot.png +yarn.lock diff --git a/package.json b/package.json new file mode 100644 index 0000000..30999fb --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "cerebro-searx", + "version": "1.0.0", + "description": "Cerebro plugin to search using a Searx instance", + "license": "MIT", + "repository": "scottwallacesh/cerebro-searx", + "author": { + "name": "Scott Wallace", + "email": "scott@wallace.sh", + "url": "https://scott.wallace.sh" + }, + "engines": { + "node": ">=4" + }, + "dependencies": { + "cerebro-tools": "^0.1.8", + "cerebro-ui": "^0.0.16" + }, + "devDependencies": { + "cerebro-scripts": "0.0.25" + }, + "main": "dist/index.js", + "keywords": [ + "cerebro", + "cerebro-plugin", + "search", + "searx" + ], + "scripts": { + "start": "cerebro-scripts start", + "build": "cerebro-scripts build", + "test": "cerebro-scripts test", + "clear": "cerebro-scripts clear", + "prepublish": "yarn clear && yarn build" + } + } diff --git a/src/ic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y1S zBK3_TCo?H}-pxTFtKUOGjy7DYMQCQlUxV$&T`d_&W2Mxe@94hh(WwdM1R?X~ok`p> zUb`d(Ft#LZTV&acnh{l5usN92G)1=|W?(u3f6aA_zv3qd74_~(#l2Iy)>x^L%_r5j@Nd!^e;HGWUfO zm7&n^!Vi(5gX$iimzyViXU~L3qRYq<-iN}~T8c2*+_a~3J=8K#tpdTv2ObmMlQU~? z5nl5lRe>j$#uPL?Q9P&_dU?hP@r#z)xtIf3JluB?Im>Pa&*7t**^izEAY4T^Fqc|B zupS(#?YKj1R*~h2hThcJUuZOc88@S)6mTNCWoIK~PK!7Z^h$%OM=i_Ps;<(&NBJ2$ zzjeqjueCE+rN-{HL-CdVe#U}P#XGRyue9j**2-Xo>hQ+7!QV-@kT%zfzi7{1j$>6& zv}s=uHK{ipw(VcMfyV!6kmGyz_BZVLx}wVV85x { + const result = { + icon, + order, + title: "Searx lookup: " + term, + subtitle: settings.url, + term, + onSelect: () => actions.open(settings.url + "/?q=" + term) + }; + + display(result); +}; + +module.exports = { + fn: lookup, + settings: { + url: { + type: "string", + description: "Base URL for the Searx engine" + } + } +};