<commit_before><commit_msg>Add inted-able ANSI image stream<commit_after>#!/usr/bin/env zsh
# Simple inetd-able ANSI image streamer using the JSON-formatted
# stream from fountain.hakase.org.
#
# requires img2txt from libcaca / caca-utils
# and jq.

BOARD=$1

curl --compressed -s http://fountain.hakase.org/v1/$BOARD/json |\
while read -r line; do
  if [[ -n "$line" ]]; then
    (jq -r 'select(.tim) | [.tim, (if .resto == 0 then .no else .resto end)]|@sh' <<< "$line") \
    | while read tim tno; do
      echo;
      img2txt -W 80 -f utf8 -d fstein \
        =(curl -s http://phosphene.hakase.org/$BOARD/thumbs/$tno/${tim}s.jpg);
    done;
  fi;
done
{'fraction_non_alphanumeric': 0.16819571865443425, 'fraction_numerical': 0.012232415902140673, 'mean_word_length': 2.8757396449704142, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1253239', 'n_tokens_mistral': 269, 'n_tokens_neox': 255, 'n_words': 70}