Initial check-in of code

This commit is contained in:
Scott Wallace 2019-09-14 16:41:02 +01:00
commit 01756fd3fd
5 changed files with 92 additions and 0 deletions

23
.gitignore vendored Normal file
View file

@ -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

4
.npmignore Normal file
View file

@ -0,0 +1,4 @@
src
node_modules
screenshot.png
yarn.lock

36
package.json Normal file
View file

@ -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"
}
}

BIN
src/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

29
src/index.js Normal file
View file

@ -0,0 +1,29 @@
const React = require("react");
const icon = require("./icon.png");
const { search, shellCommand } = require("cerebro-tools");
const order = 10;
const lookup = ({ term, actions, display, settings }) => {
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"
}
}
};