assets/index.js
function before_photo_post(test, callback){
	hello(test.network)
	.api("me/albums")
	.then(function(r){
		for(var i=0;i<r.data.length;i++){
			if(r.data[i].name === "TestAlbum"){
				var id = r.data[i].id;
				test.data.id = id;
				return callback();
			}
		}
		callback("Failed to setup: Could not find the album 'TestAlbum'");
	}, function(){
		callback("Failed to setup: could not access me/albums");
	});
}
function before_photo_post(test, callback){
	hello(test.network)
	.api("me/albums")
	.then(function(r){
		for(var i=0;i<r.data.length;i++){
			if(r.data[i].name === "TestAlbum"){
				var id = r.data[i].id;
				test.data.id = id;
				return callback();
			}
		}
		callback("Failed to setup: Could not find the album 'TestAlbum'");
	}, function(){
		callback("Failed to setup: could not access me/albums");
	});
}
function before_photo_post ( test , callback ) { hello ( test . network ) . api ( "me/albums" ) . then ( function ( r ) { for ( var i = 0 ; i < r . data . length ; i ++ ) { if ( r . data [ i ] . name === "TestAlbum" ) { var id = r . data [ i ] . id ; test . data . id = id ; return callback ( ) ; } } callback ( "Failed to setup: Could not find the album 'TestAlbum'" ) ; } , function ( ) { callback ( "Failed to setup: could not access me/albums" ) ; } ) ; }
Get the ID of the test album
Get the ID of the test album