Skip to content

Instantly share code, notes, and snippets.

@hugohil
Last active November 10, 2016 11:52
Show Gist options
  • Save hugohil/7be80f71fe4d38945705 to your computer and use it in GitHub Desktop.
Save hugohil/7be80f71fe4d38945705 to your computer and use it in GitHub Desktop.
Where you should eat lunch
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