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

https://github.com/pirxpilot/cse

Google custom search engine on your page
https://github.com/pirxpilot/cse

Last synced: over 1 year ago
JSON representation

Google custom search engine on your page

Awesome Lists containing this project

README

          

# cse

Use Google [custom search engine][cse] on your page.

See in the wild on the [American Scenic Byways][byways.site] website - _[source][byways.src]_.

## Installation

Install with [npm](http://npmjs.org):

$ npm install cse

## API

You need to create [custom search engine][cse] and obtain search engine ID whithc looks like this:
`012345678901234567890:abcdefghijk`

Add `#cseSearchBox` or `#cseSearchResults` (or both) to your HTML and then initialize them with
google's magic.

````javascript
var cseID = "012345678901234567890:abcdefghijk";
require('cse')(cseID);
````

If neither `#cseSearchBox` nor `#cseSearchResults` are found we die silently without trying to load
any scripts from google.

## License

MIT

[cse]: http://google.com/cse
[byways.site]: http://scenicbyways.info/search.html?q=ground
[byways.src]: https://github.com/melitele/byways