Page MenuHomeSoftware Heritage
Paste P942

jitsiroom - get a fresh URL for a Jitsi room
ActivePublic

Authored by zack on Feb 8 2021, 10:31 AM.
#!/bin/bash
# SPDX-FileCopyrightText: © 2021 Stefano Zacchiroli <zack@upsilon.cc>
# SPDX-License-Identifier: GPL-3.0-or-later
# Usage:
#
# $ jitsiroom
# https://meet.jit.si/TreasureNikeIrsGarage
JITSI_URL="https://meet.jit.si/"
ROOM_NAME_LEN=4
WORD_LIST_URL="https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt"
WORD_LIST="${HOME}/.cache/$(basename ${WORD_LIST_URL})"
if ! [ -f "$WORD_LIST" ] ; then
echo "I: word list not found, downloading and caching it"
mkdir -p $(dirname "$WORD_LIST")
if ! wget -O "$WORD_LIST" "$WORD_LIST_URL" ; then
echo "E: failed to retrieve word list from ${WORD_LIST_URL}, stopping."
exit 2
fi
fi
echo -n "$JITSI_URL"
for word in $(shuf -n "$ROOM_NAME_LEN" "$WORD_LIST") ; do
echo -n ${word^}
done
echo

Event Timeline

zack changed the title of this paste from Command-Line Input to jitsiroom - get a fresh URL for a Jitsi room.Feb 8 2021, 10:31 AM
zack updated the paste's language from autodetect to bash.