Created
August 20, 2018 06:34
-
-
Save hsugawa8651/b8894e38b1906020cb5f2aac19886561 to your computer and use it in GitHub Desktop.
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"using HTTP\n", | |
"using JSON\n", | |
"using DataStructures" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"\"https://gist.githubusercontent.com/anonymous/8d51c367d5cee2828f3da30390033010/raw/72429b9bc6fe08e8c7dbc2f9c3dbdfebdfdeeefa/Untitled10.ipynb\"" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"target=\"https://gist.githubusercontent.com/anonymous/8d51c367d5cee2828f3da30390033010/raw/72429b9bc6fe08e8c7dbc2f9c3dbdfebdfdeeefa/Untitled10.ipynb\"" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"r=HTTP.get(target);" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"DataStructures.OrderedDict{String,Any} with 4 entries:\n", | |
" \"cells\" => Any[DataStructures.OrderedDict{String,Any}(\"cell_type\"=>\"…\n", | |
" \"metadata\" => DataStructures.OrderedDict{String,Any}(\"kernelspec\"=>Data…\n", | |
" \"nbformat\" => 4\n", | |
" \"nbformat_minor\" => 2" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"jj=JSON.parse( String(r.body) , dicttype=OrderedDict)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"using PyPlot\n", | |
"ts=linspace(0,2pi)\n", | |
"plot( ts .* cos.(ts), ts .* sin.(ts))\n" | |
] | |
} | |
], | |
"source": [ | |
"for cell in jj[\"cells\"]\n", | |
" if cell[\"cell_type\"]==\"code\"\n", | |
" for text in cell[\"source\"]\n", | |
" println(text)\n", | |
" end\n", | |
" end\n", | |
"end" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Julia 0.6.4", | |
"language": "julia", | |
"name": "julia-0.6" | |
}, | |
"language_info": { | |
"file_extension": ".jl", | |
"mimetype": "application/julia", | |
"name": "julia", | |
"version": "0.6.4" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment