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

read -p "Email: " email
read -s -p "Password: " <PASSWORD>

echo
echo -n 'Connecting...'

res=$(curl -s --data "email=${email}&pwd=${psswd}" \
     'https://gface.com/api/-text/auth/login.json')

grep 'fail' <<< $res && exit 1
echo 'done'

token=$(sed 's/^.*token":"\([-0-9a-f]*\).*$/\1/' <<< ${res})
userid=$(sed 's/^.*userid":\([0-9]*\).*$/\1/' <<< ${res})

./wb ${token} ${userid} eu # Europe server (others: na/tr)<commit_msg>Fix wb.sh syntax for MSYS shell (MinGW)<commit_after>#!/usr/bin/env bash
# Usage: wb.sh [eu|na|tr]

read -p "Email: " email
read -s -p "Password: " <PASSWORD>

echo
echo -n 'Connecting...'

res=$(curl -ks --data "email=${email}&pwd=${<PASSWORD>}" \
     'https://gface.com/api/-text/auth/login.json')

echo "$res" | grep 'fail' && exit 1
echo 'done'

token=$(echo "$res" | sed 's/^.*token":"\([-0-9a-f]*\).*$/\1/')
userid=$(echo "$res" | sed 's/^.*userid":\([0-9]*\).*$/\1/')

./wb ${token} ${userid} $1
{'fraction_non_alphanumeric': 0.30546955624355004, 'fraction_numerical': 0.015479876160990712, 'mean_word_length': 3.409090909090909, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '2150853', 'n_tokens_mistral': 434, 'n_tokens_neox': 418, 'n_words': 89}