Skip to content

Commit

Permalink
jshint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanjudis committed Jun 4, 2015
1 parent 7d8e179 commit fef2e97
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 28 deletions.
8 changes: 3 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
var express = require( 'express' );
var compression = require( 'compression' );
var md5 = require( 'MD5' );
var app = express();
var fs = require( 'fs' );
var fuzzify = require( './lib/fuzzify' );
var _ = require( 'lodash' );
var minify = require( 'html-minifier' ).minify;
var request = require( 'request' );
var config = require( './config/config' );
var async = require( 'async' );
var cookieParser = require( 'cookie-parser' );
Expand Down Expand Up @@ -224,7 +222,7 @@ function fetchVideoMeta() {
setTimeout( function() {
done( null );
}, config.timings.requestDelay );
} )
} );
} );
}

Expand All @@ -247,7 +245,7 @@ function fetchVideoMeta() {
setTimeout( function() {
done( null );
}, config.timings.requestDelay );
} )
} );
} );
}
} );
Expand Down Expand Up @@ -286,7 +284,7 @@ function fetchSlideMeta() {
setTimeout( function() {
done( null );
}, config.timings.requestDelay );
} )
} );
} else {
done( null );
}
Expand Down
12 changes: 8 additions & 4 deletions lib/helper/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ var Github = {
}
},
function( error, response, body ) {
var contributors;

if ( error ) {
callback( error );
}
Expand Down Expand Up @@ -69,16 +71,18 @@ var Github = {
}
},
function( error, response, body ) {
var stars;

if ( error ) {
return callback( error )
return callback( error );
} else {
if ( response && response.statusCode === 404 ) {
return callback(
new Error( 'NOT FOUND: ' + url )
);
} else {
try {
var stars = JSON.parse( body ).stargazers_count;
stars = JSON.parse( body ).stargazers_count;
} catch( e ) {
return callback( e );
}
Expand All @@ -92,10 +96,10 @@ var Github = {
return callback( null, ~~( Math.random() * 1000 ) );
}
}
}
};

module.exports = {
init : function() {
return Object.create( Github );
}
}
};
11 changes: 6 additions & 5 deletions lib/helper/slideshare.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var config = require( '../../config/config' );
var request = require( 'request' );

var Slideshare = {
Expand All @@ -20,11 +19,13 @@ var Slideshare = {
}
},
function( error, response, body ) {
var meta;

if ( error ) {
return callback( error )
return callback( error );
} else {
try {
var meta = JSON.parse( body );
meta = JSON.parse( body );
} catch( e ) {
return callback( e );
}
Expand All @@ -46,10 +47,10 @@ var Slideshare = {
}
);
}
}
};

module.exports = {
init : function() {
return Object.create( Slideshare );
}
}
};
10 changes: 5 additions & 5 deletions lib/helper/speakerdeck.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var config = require( '../../config/config' );
var request = require( 'request' );

var Slideshare = {
Expand All @@ -19,11 +18,12 @@ var Slideshare = {
}
},
function( error, response, body ) {
var meta;
if ( error ) {
return callback( error )
return callback( error );
} else {
try {
var meta = JSON.parse( body );
meta = JSON.parse( body );
} catch( e ) {
return callback( e );
}
Expand All @@ -46,10 +46,10 @@ var Slideshare = {
}
);
}
}
};

module.exports = {
init : function() {
return Object.create( Slideshare );
}
}
};
6 changes: 3 additions & 3 deletions lib/helper/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var Twitter = {
twit.get(
'/users/show/:id',
{ id : userName },
function( err, twitterData, res ) {
function( err, twitterData ) {
if ( err ) {
return callback( err );
}
Expand All @@ -53,10 +53,10 @@ var Twitter = {
);
}
}
}
};

module.exports = {
init : function() {
return Object.create( Twitter );
}
}
};
6 changes: 3 additions & 3 deletions lib/helper/vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var Vimeo = {
if ( credentialsSet ) {
vimeo.request( {
path : '/videos/' + id
}, function( error, body, statusCode ) {
}, function( error, body ) {
if ( error ) {
return callback( error );
}
Expand Down Expand Up @@ -63,10 +63,10 @@ var Vimeo = {
);
}
}
}
};

module.exports = {
init : function() {
return Object.create( Vimeo );
}
}
};
4 changes: 2 additions & 2 deletions lib/helper/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ var Youtube = {
);
}
}
}
};

module.exports = {
init : function() {
return Object.create( Youtube );
}
}
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
},
"homepage": "http://perf-tooling.today",
"dependencies": {
"MD5": "^1.2.1",
"async": "^0.9.0",
"compression": "^1.1.0",
"cookie-parser": "^1.3.4",
Expand Down

0 comments on commit fef2e97

Please sign in to comment.