Skip to content

Instantly share code, notes, and snippets.

@kevupton
Last active December 8, 2015 12:39
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 kevupton/a5a2f37319f6aa1c2f2c to your computer and use it in GitHub Desktop.
Save kevupton/a5a2f37319f6aa1c2f2c to your computer and use it in GitHub Desktop.
Woooo
function cus_func(input, search) {
var list = search.split(/[\[\]\.]/);
var new_key;
for (var key in list) {
new_key = list[key].replace(/^['"](.*?)['"]$/gm, '$1');
input = ImageHelper.get(input, new_key);
}
console.log(input);
}
cus_fun(this.props.post, '_embedded["http://api.w.org/featuredmedia"][0].source_url');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment