<commit_before>#!/usr/bin/env fish

echo 'Starting Chrome'
set cmd 'env DISPLAY=:0 chromium-browser --disable-gpu --headless --remote-debugging-port=9222'
echo "$cmd"
eval "$cmd &"
sleep 5

set pid (pgrep -f "chromium-browser")
echo "$pid"

set basedir (dirname "$0")
echo 'Gathering and scraping classes'
mkdir -p "$basedir/courses"
set date (date -Idate)
set coursefile "$basedir/courses/courses_$date.json"
set cmd "node $basedir/toplevel.js $basedir/studios_test.json $coursefile"
echo "$cmd"
eval "$cmd"

if test -e $coursefile
  echo 'All done, removing previous later values'
  node sendtomongo.js $coursefile
else
  echo 'Something went wrong, holding off on importing'
end

echo "Killing chrome"
kill -9 $pid
<commit_msg>Scrape all studios<commit_after>#!/usr/bin/env fish

echo 'Starting Chrome'
set cmd 'env DISPLAY=:0 chromium-browser --disable-gpu --headless --remote-debugging-port=9222'
echo "$cmd"
eval "$cmd &"
sleep 5

set pid (pgrep -f "chromium-browser")
echo "$pid"

set basedir (dirname "$0")
echo 'Gathering and scraping classes'
mkdir -p "$basedir/courses"
set date (date -Idate)
set coursefile "$basedir/courses/courses_$date.json"
set cmd "node $basedir/toplevel.js $basedir/studios.json $coursefile"
echo "$cmd"
eval "$cmd"

if test -e $coursefile
  echo 'All done, removing previous later values'
  node sendtomongo.js $coursefile
else
  echo 'Something went wrong, holding off on importing'
end

echo "Killing chrome"
kill -9 $pid

{'fraction_non_alphanumeric': 0.12602739726027398, 'fraction_numerical': 0.010958904109589041, 'mean_word_length': 4.774703557312253, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6384986', 'n_tokens_mistral': 524, 'n_tokens_neox': 497, 'n_words': 172}