Last active
August 29, 2015 14:18
-
-
Save jaredpalmer/7b58dc941d8d24e39160 to your computer and use it in GitHub Desktop.
Modify Kimono API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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