Created
October 14, 2016 03:20
-
-
Save ku/c6c7ad90394dad52623f79064b2871b0 to your computer and use it in GitHub Desktop.
esa.io transclude
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() { | |
var me = document.scripts[document.scripts.length - 1]; | |
var token = me.src.match(/token=(\w+)/)[1]; | |
var q = 'dev/esa/api name:v1' | |
var u = 'https://api.esa.io/v1/teams/docs/posts?access_token=' + token + '&q=' + q; | |
fetch(u).then(function (r){ | |
r.json().then(function(r){ | |
r.posts.forEach(function (post) { | |
var div = document.createElement("div") | |
div.innerHTML= post.body_html | |
me.parentNode.insertBefore(div, null) | |
}) | |
})} ) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment