An open API service indexing awesome lists of open source software.

https://github.com/umd-lib/website-searcher

Libraries' Website Searcher
https://github.com/umd-lib/website-searcher

Last synced: 11 months ago
JSON representation

Libraries' Website Searcher

Awesome Lists containing this project

README

          

# website-searcher

Python 3 Flask application to search the Libraries' website; provides a backend searcher to a Bento Box style search
which expects a REST interface following the Quick Search model.

## Requires

* Python 3.10.8

### Development Setup

See [docs/DevelopmentSetup.md](docs/DevelopmentSetup.md).

### Running in Docker

```bash
$ docker build -t website-searcher .
$ docker run -it --rm -p 5000:5000 --env-file=.env --read-only website-searcher
```

### Building for Kubernetes

```bash
$ docker buildx build . --builder=kube -t docker.lib.umd.edu/website-searcher:VERSION --push
```

### Endpoints

This will start the webapp listening on the default port 5000 on localhost
(127.0.0.1), and running in [Flask's debug mode].

Root endpoint (just returns `{status: ok}` to all requests):

/ping endpoint (just returns `{status: ok}` to all requests):

/search endpoint: `http://localhost:5000/search?q={query}&page={page number?}&per_page={results per page?}`

Example:

```bash
curl 'http://localhost:5000/search?q=jstor&per_page=3&page=0'
{
"endpoint": "website-search",
"module_link": "https://search.lib.umd.edu/website?query=jstor",
"no_results_link": "https://search.lib.umd.edu/website",
"page": "0",
"per_page": "3",
"query": "jstor",
"results": [
{
"description": "Sep 14, 2017 ... JSTOR Retention Policy | JSTOR is an electronic archive of core journals in the humanities, social sciences, and sciences.",
"extra": {
"displayLink": "www.lib.umd.edu",
"htmlSnippet": "Sep 14, 2017 ... JSTOR Retention Policy | JSTOR is an electronic archive of core journals in the humanities, social sciences, and sciences.",
"snippet": "Sep 14, 2017 ... JSTOR Retention Policy | JSTOR is an electronic archive of core journals in the humanities, social sciences, and sciences."
},
"item_format": "web_page",
"link": "https://www.lib.umd.edu/collections/policies/jstor-retention-policy",
"title": "JSTOR Retention Policy - Collections"
},
{
"description": "As the largest university library system in the Washington D.C.-Baltimore area, the University Libraries serve 37000 students and faculty of the flagship ...",
"extra": {
"displayLink": "www.lib.umd.edu",
"htmlSnippet": "As the largest university library system in the Washington D.C.-Baltimore area, the University Libraries serve 37000 students and faculty of the flagship ...",
"snippet": "As the largest university library system in the Washington D.C.-Baltimore area, the University Libraries serve 37000 students and faculty of the flagship ..."
},
"item_format": "web_page",
"link": "https://www.lib.umd.edu/",
"title": "University of Maryland Libraries"
},
{
"description": "Oct 7, 2021 ... Remote access to library resources is available for all current University of Maryland, College Park students, faculty, and staff. Database ...",
"extra": {
"displayLink": "www.lib.umd.edu",
"htmlSnippet": "Oct 7, 2021 ... Remote access to library resources is available for all current University of Maryland, College Park students, faculty, and staff. Database ...",
"snippet": "Oct 7, 2021 ... Remote access to library resources is available for all current University of Maryland, College Park students, faculty, and staff. Database ..."
},
"item_format": "web_page",
"link": "https://www.lib.umd.edu/services/remote-access",
"title": "How do I Connect to Electronic Resources Off-Campus? | UMD ..."
}
],
"total": 854
}

```

[Flask's debug mode]: https://flask.palletsprojects.com/en/2.2.x/cli/?highlight=debug%20mode

## License

See the [LICENSE](LICENSE.txt) file for license rights and limitations.