Skip to content

Instantly share code, notes, and snippets.

@jaredpalmer
Last active August 29, 2015 14:18
Show Gist options
  • Save jaredpalmer/7b58dc941d8d24e39160 to your computer and use it in GitHub Desktop.
Save jaredpalmer/7b58dc941d8d24e39160 to your computer and use it in GitHub Desktop.
Modify Kimono API
function transform(data) {
// filter functions are passed the whole API response object
// you may manipulate or add to this data as you want
// query parameters exist in the global scope, for example:
// http://www.kimonolabs.com/apis/<API_ID>/?apikey=<API_KEY>&myparam=test
// query.myparam == 'test'; // true
for (var i = 0; i< data.results.collection1.length; i++){
var link = decodeURIComponent(data.results.stories[i].title.href)
var index = link.indexOf('=');
data.results.collection1[i].title.href = link.slice(index+1,link.length);
}
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment