受け取ったリストからランダムにひとつ選ぶコマンド
というのがあれば、いろんなことに使えるのではないか

randsel.rblines = ARGF.collect { |line|
line.chomp
}
puts lines[rand(lines.length)]
sample.shwget -q -O - https://scrapbox.io/api/pages/villagepump/豆知識/text | grep '^ ' | grep -v '\t' | grep -v ' ' | ruby randsel.rb
意外と便利?

こういうのは既にあるか?

情報感謝 >

豆知識をランダム表示する mame
コマンド
mame.sh% cat mame
wget -q -O - https://scrapbox.io/api/pages/villagepump/豆知識/text | grep '^ ' | grep -v '\t' | grep -v ' ' | shuf -n1 | tr -d '\\[\\] '
% ./mame
クレジットカードを何度も紛失すると、会員資格を取られる場合がある
% ./mame
各種サプリは「毒ではない」が効果があることは稀
%
これ面白いなあ
