Created
August 4, 2015 14:34
-
-
Save mayrund/cf865ef36e4aee3e7d70 to your computer and use it in GitHub Desktop.
remove text from json collection
This file contains 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 | |
function removeWord(text, wordToRemove) { | |
text = text.replace(wordToRemove, '') | |
return text; | |
} | |
for(var item in data.results.links) { | |
data.results.links[item].link.href = removeWord(data.results.links[item].link.href, 'bezichtigen') | |
} | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment