Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/driebit/mod_ginger_opensearch
Zotonic module for searching OpenSearch APIs
https://github.com/driebit/mod_ginger_opensearch
Last synced: 2 days ago
JSON representation
Zotonic module for searching OpenSearch APIs
- Host: GitHub
- URL: https://github.com/driebit/mod_ginger_opensearch
- Owner: driebit
- License: mit
- Created: 2015-03-25T09:01:01.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T13:47:59.000Z (almost 10 years ago)
- Last Synced: 2023-08-03T20:12:02.546Z (over 1 year ago)
- Language: Erlang
- Size: 152 KB
- Stars: 0
- Watchers: 20
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mod_ginger_opensearch
=====================A Zotonic module for searching [OpenSearch](http://www.opensearch.org/Specifications/OpenSearch)
APIs.Installation
------------This module depends on [mod_ginger_xml](https://github.com/driebit/mod_ginger_xml),
so make sure to install that, too.Usage
-----```erlang
{Result, Items} = opensearch:search(
"http://example.com/OpenSearch", % API URL
"this AND that" % search terms
).
````Result` will contain the OpenSearch results metadata; `Items` a list of items.
You can parse those items with `xmerl`:```erlang
lists:map(
fun(Item) ->
Title = ginger_xml:get_value("//title", Item)
%% Go and do cool stuff with the data!
end,
Items
).
```To specify the count, index and page parameters:
```erlang
{Result, Items} = opensearch:search(
"http://example.com/OpenSearch",
"this AND that",
100, % count
10, % start index
2 % start page
).
```