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
- Host: GitHub
- URL: https://github.com/pirxpilot/cse
- Owner: pirxpilot
- License: mit
- Created: 2013-10-11T14:52:17.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-03-09T08:32:42.000Z (over 9 years ago)
- Last Synced: 2025-03-01T19:03:44.556Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
- License: License.txt
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