Created
November 25, 2017 14:04
-
-
Save bcswartz/bfd591b6f1e55ef86a29a08b1e2d0ae3 to your computer and use it in GitHub Desktop.
Grunt file with the grunt-open plugin for opening certain websites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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