Skip to content

Instantly share code, notes, and snippets.

@bcswartz
Created November 25, 2017 14:04
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 bcswartz/bfd591b6f1e55ef86a29a08b1e2d0ae3 to your computer and use it in GitHub Desktop.
Save bcswartz/bfd591b6f1e55ef86a29a08b1e2d0ae3 to your computer and use it in GitHub Desktop.
Grunt file with the grunt-open plugin for opening certain websites
module.exports = function( grunt )
{
grunt.initConfig({
open: {
joyoftech: {
path: 'http://www.geekculture.com/joyoftech/',
app: 'Chrome'
},
dilbert: {
path: 'http://www.dilbert.com/',
app: 'Chrome'
},
xkcd: {
path: 'http://www.xkcd.com/',
app: 'Chrome'
},
xkcdwhatif: {
path: 'http://what-if.xkcd.com/',
app: 'Chrome'
}
}
});
grunt.loadNpmTasks( 'grunt-open' );
grunt.registerTask( 'webhumor', 'Load the funnies!', function() {
var today = new Date();
var dayOfWeek = today.getDay();
switch( dayOfWeek ) {
case 1: //Monday
case 3:
case 5:
grunt.task.run( [ 'open:joyoftech', 'open:dilbert', 'open:xkcd' ] );
break;
case 0:
case 6:
case 2:
grunt.task.run( [ 'open:dilbert' ] );
break;
case 4:
grunt.task.run( [ 'open:dilbert', 'open:xkcdwhatif' ] );
break;
}
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment