Skip to content

Instantly share code, notes, and snippets.

@mayrund
Created August 4, 2015 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayrund/cf865ef36e4aee3e7d70 to your computer and use it in GitHub Desktop.
Save mayrund/cf865ef36e4aee3e7d70 to your computer and use it in GitHub Desktop.
remove text from json collection
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