Last active
November 10, 2016 11:52
-
-
Save hugohil/7be80f71fe4d38945705 to your computer and use it in GitHub Desktop.
Where you should eat lunch
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
var Slack = require('node-slack'); | |
var slack = new Slack('https://hooks.slack.com/services/your/hook/key'); | |
var places = ["Ecole", "Japonais-chinois", "Jumbo", "Lotus", "Franprix", "Castro", "Picard", "Khmer babtou", "Frères Bedri", "Bagel hipster", "Flesh"]; | |
console.log('Yaourtotron 1.0\n©Soixante circuits. Tout droits réservés.'); | |
console.log('Les différents choix sont:'); | |
for(var i = 0; i < places.length; i++){ | |
console.log(' - ' + places[i]); | |
} | |
console.log('\n\nEt le résultat est:'); | |
var result = places[Math.floor(Math.random() * places.length)]; | |
slack.send({ | |
text: "Eh chef, la boisson avec ton " + result + " ?", | |
channel: '#yaourt', | |
username: 'Chef', | |
icon_emoji: ':fork_and_knife:' | |
}); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment