Skip to content

Instantly share code, notes, and snippets.

@fredowsley
Last active March 25, 2020 16:45
Show Gist options
  • Save fredowsley/1d1bbbade336eb2f97f4273f4406c402 to your computer and use it in GitHub Desktop.
Save fredowsley/1d1bbbade336eb2f97f4273f4406c402 to your computer and use it in GitHub Desktop.
Create random Google Hangout links, find random meetings.
const http = require('http');
const randexp = require('randexp').randexp;
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.writeHead(200, {
'Content-Type': 'text/html'
});
res.write(`<html><body><h1>10 Random Google Hangouts!</h1><ul>`);
for (let step = 0; step < 10; step++) {
var randdata = randexp(/[a-z]{3}-[a-z]{4}-[a-z]{3}/);
res.write(`<li><a href="https://meet.google.com/`+randdata+`">https://meet.google.com/`+randdata+`</a><br>`);
}
res.write(`</ul><p><h6><a href="https://gist.github.com/fredowsley">@fredowsley</a></h6></body</html>`);
res.end();
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment