Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created March 27, 2014 14:21
/* 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