Created
October 11, 2020 20:39
-
-
Save B45i/04d0dfc0c31bfd721a961fda89537c8b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/salolew
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.container { | |
width: 80%; | |
background-color: #ddd; | |
margin: 30px auto; | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
grid-auto-columns: 30px; | |
grid-gap: 10px; | |
padding: 10px | |
} | |
.pic > img { | |
max-width: 100%; | |
width: -webkit-fill-available; | |
} | |
</style> | |
</head> | |
<body> | |
<div class=container> | |
</div> | |
<script id="jsbin-javascript"> | |
fetch("https://www.instagram.com/b45i.me/?__a=1") | |
.then(response => response.json()) | |
.then(data => render(parseData(data))); | |
const parseData = data => (data.graphql.user.edge_owner_to_timeline_media.edges || []) | |
.map(x => x.node.thumbnail_src); | |
const render = imgs => { | |
document.querySelector('.container').innerHTML = (imgs || []).reduce((html, img) => html += `<div class="pic"><img src="${img}" alt=""></div>`, '');; | |
} | |
</script> | |
<script id="jsbin-source-css" type="text/css">.container { | |
width: 80%; | |
background-color: #ddd; | |
margin: 30px auto; | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
grid-auto-columns: 30px; | |
grid-gap: 10px; | |
padding: 10px | |
} | |
.pic > img { | |
max-width: 100%; | |
width: -webkit-fill-available; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">fetch("https://www.instagram.com/b45i.me/?__a=1") | |
.then(response => response.json()) | |
.then(data => render(parseData(data))); | |
const parseData = data => (data.graphql.user.edge_owner_to_timeline_media.edges || []) | |
.map(x => x.node.thumbnail_src); | |
const render = imgs => { | |
document.querySelector('.container').innerHTML = (imgs || []).reduce((html, img) => html += `<div class="pic"><img src="${img}" alt=""></div>`, '');; | |
}</script></body> | |
</html> |
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
.container { | |
width: 80%; | |
background-color: #ddd; | |
margin: 30px auto; | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
grid-auto-columns: 30px; | |
grid-gap: 10px; | |
padding: 10px | |
} | |
.pic > img { | |
max-width: 100%; | |
width: -webkit-fill-available; | |
} |
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
fetch("https://www.instagram.com/b45i.me/?__a=1") | |
.then(response => response.json()) | |
.then(data => render(parseData(data))); | |
const parseData = data => (data.graphql.user.edge_owner_to_timeline_media.edges || []) | |
.map(x => x.node.thumbnail_src); | |
const render = imgs => { | |
document.querySelector('.container').innerHTML = (imgs || []).reduce((html, img) => html += `<div class="pic"><img src="${img}" alt=""></div>`, '');; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment