Skip to content

Instantly share code, notes, and snippets.

@B45i
Created October 11, 2020 20: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 B45i/04d0dfc0c31bfd721a961fda89537c8b to your computer and use it in GitHub Desktop.
Save B45i/04d0dfc0c31bfd721a961fda89537c8b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/salolew
<!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>
.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;
}
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