Skip to content

Instantly share code, notes, and snippets.

@jssee
Last active June 7, 2017 16:06
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 jssee/c903a39bc663b4693b3872bf04584d76 to your computer and use it in GitHub Desktop.
Save jssee/c903a39bc663b4693b3872bf04584d76 to your computer and use it in GitHub Desktop.
Use fetch to get your dribbble shots.
const url = 'https://api.dribbble.com/v1/users/USERNAME/shots?access_token=TOKEN&callback';
fetch(url)
.then(response => response.json())
.then(function(data) {
[].forEach.call(data, function(post) {
let list = document.querySelector('#dribbble');
let html = `
<li>
<a href="${post.html_url}" target="_blank">
<img src="${post.images.normal}">
</a>
</li>
`;
console.log(post);
list.innerHTML += html;
})
});
@jssee
Copy link
Author

jssee commented Apr 14, 2017

Instructions

  1. Register an application from your Dribbble account
  2. Grab that Client Access Token
  3. Replace USERNAME with your dribbble username, replace TOKEN with your Client Access Token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment