Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created March 27, 2014 14:21
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 cfjedimaster/9808621 to your computer and use it in GitHub Desktop.
Save cfjedimaster/9808621 to your computer and use it in GitHub Desktop.
/* global $,console,document,behanceAPI */
var behancekey = "REPLACE ME";
$(document).ready(function() {
//Set my key
behanceAPI.setKey(behancekey);
behanceAPI.getProjectsForUser("gwilson", function(res) {
console.dir(res);
var result = "";
for(var i=0;i<res.length; i++) {
if(i==0 || i%3 == 0) {
result += "<div class='pure-g-r'>\n";
}
var image = res[i].covers[115];
result += "<div class='pure-u-1-3'>"+image+"</div>\n";
if((i>0 && (i+1) % 3 == 0) || i == res.length-1) {
result += "</div>\n";
}
}
console.log(result);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment