flickr-image-downloader.js
function FlickrImageDownloader () {
	var that = this;
	
	that.url = '';
	that.delay = 500;
	that.downloadFolder = '';

	that.paths = {};
	that.paths.base = 'https://www.flickr.com';
	that.paths.photostream = 'photos/!username';
	that.paths.set = that.paths.photostream + '/sets';
	that.paths.favorites = that.paths.photostream + '/favorites';

	that.image = {};
	that.image.dataAttr = 'deferSrc';
	that.image.selector = 'div#photo-display-container img.pc_img';	
	
	// Events constructor
	events.EventEmitter.call(that);

	// Setup listeners
	that.on('pageCountLoaded', function () {
		console.log('Event::pageCountLoaded');
		that.getImageUrls();
	});

	that.on('imageUrlsLoaded', function () {
		console.log('Event::imageUrlsLoaded');
		that.downloadImages();
	});

	that.on('downloadFinished', function (imageUrl) {
		console.log('Event::downloadFinished(' + imageUrl + ')');
	});

	that.on('allDownloadsFinished', function () {
		console.log('Event::allDownloadsFinished');
	});

	that.on('error', function (functionName, error) {
		console.log('Event::Error (' + functionName + ')', error);
	});
}
function FlickrImageDownloader () {
	var that = this;
	
	that.url = '';
	that.delay = 500;
	that.downloadFolder = '';

	that.paths = {};
	that.paths.base = 'https://www.flickr.com';
	that.paths.photostream = 'photos/!username';
	that.paths.set = that.paths.photostream + '/sets';
	that.paths.favorites = that.paths.photostream + '/favorites';

	that.image = {};
	that.image.dataAttr = 'deferSrc';
	that.image.selector = 'div#photo-display-container img.pc_img';	
	
	// Events constructor
	events.EventEmitter.call(that);

	// Setup listeners
	that.on('pageCountLoaded', function () {
		console.log('Event::pageCountLoaded');
		that.getImageUrls();
	});

	that.on('imageUrlsLoaded', function () {
		console.log('Event::imageUrlsLoaded');
		that.downloadImages();
	});

	that.on('downloadFinished', function (imageUrl) {
		console.log('Event::downloadFinished(' + imageUrl + ')');
	});

	that.on('allDownloadsFinished', function () {
		console.log('Event::allDownloadsFinished');
	});

	that.on('error', function (functionName, error) {
		console.log('Event::Error (' + functionName + ')', error);
	});
}
function FlickrImageDownloader ( ) { var that = this ; that . url = '' ; that . delay = 500 ; that . downloadFolder = '' ; that . paths = { } ; that . paths . base = 'https://www.flickr.com' ; that . paths . photostream = 'photos/!username' ; that . paths . set = that . paths . photostream + '/sets' ; that . paths . favorites = that . paths . photostream + '/favorites' ; that . image = { } ; that . image . dataAttr = 'deferSrc' ; that . image . selector = 'div#photo-display-container img.pc_img' ; // Events constructor events . EventEmitter . call ( that ) ; // Setup listeners that . on ( 'pageCountLoaded' , function ( ) { console . log ( 'Event::pageCountLoaded' ) ; that . getImageUrls ( ) ; } ) ; that . on ( 'imageUrlsLoaded' , function ( ) { console . log ( 'Event::imageUrlsLoaded' ) ; that . downloadImages ( ) ; } ) ; that . on ( 'downloadFinished' , function ( imageUrl ) { console . log ( 'Event::downloadFinished(' + imageUrl + ')' ) ; } ) ; that . on ( 'allDownloadsFinished' , function ( ) { console . log ( 'Event::allDownloadsFinished' ) ; } ) ; that . on ( 'error' , function ( functionName , error ) { console . log ( 'Event::Error (' + functionName + ')' , error ) ; } ) ; }
Module to export
Module to export