Skip to content

Instantly share code, notes, and snippets.

View benhinchley's full-sized avatar

Ben Hinchley benhinchley

View GitHub Profile
@benhinchley
benhinchley / install.js
Last active September 8, 2018 03:21 — forked from mish15/install.js
Dynamic content block
// 1. Assumes the following div exists in the page, note: you can change this using the "attachDynamicContent" setting
// <div id="dynamic-content"></div>
// 2. The "pipeline" parameter controls the query execution, this example uses "popular", this is configurable
// 3. The "values" map controls the query. You don't need the "q" parameter, but can use this to control the context of
// the results. For example you may wish to use the "document.title" to find related content to the current page
// 4. The filter parameter allows any number of filters to be used to filter the query results, e.g. to domains, or sections,
// or any other number of factors
var recommend = setup(window, document, "script", "sajari", "//cdn.sajari.net/js/integrations/website-search-1.4.js");
recommend({