<commit_before>#!/bin/bash

if [ ! -e ~/remnux-tools/config.cfg ]; then
    echo "Can't find ~/remnux-tools/config.cfg."
    exit 1
fi

# shellcheck disable=SC1090
. ~/remnux-tools/config.cfg

if [[ ! -e ~/.shodan/api_key && ! -z "$SHODAN_API_KEY" ]]; then
    echo -n "Initialize Shodan API (access via command shodan): "
    shodan init "$SHODAN_API_KEY"
fi

if [[ -e ~/src/python/tweets_analyzer/secrets.py ]]; then
    if grep xxxxxxxxxxxxxx ~/src/python/tweets_analyzer/secrets.py > /dev/null ; then
        if [[ ! -z "$TWITTER_CONSUMER_KEY" && ! -z "$TWITTER_CONSUMER_SECRET" \
            && ! -z "$TWITTER_ACCESS_TOKEN" && ! -z "$TWITTER_ACCESS_TOKEN_SECRET" ]]; then 
            echo 'consumer_key="'"$TWITTER_CONSUMER_KEY"'"'
            echo 'consumer_secret="'"$TWITTER_CONSUMER_SECRET"'"'
            echo 'access_token="'"$TWITTER_ACCESS_TOKEN"'"'
            echo 'access_token_secret="'"$TWITTER_ACCESS_TOKEN_SECRET"'"'
        else
            echo "No configuration for twitter in ~/remnux-tools/config.cfg"
        fi
    fi
fi
<commit_msg>Write to secrets.py for tweets_analyzer.<commit_after>#!/bin/bash

if [ ! -e ~/remnux-tools/config.cfg ]; then
    echo "Can't find ~/remnux-tools/config.cfg."
    exit 1
fi

# shellcheck disable=SC1090
. ~/remnux-tools/config.cfg

if [[ ! -e ~/.shodan/api_key && ! -z "$SHODAN_API_KEY" ]]; then
    echo -n "Initialize Shodan API (access via command shodan): "
    shodan init "$SHODAN_API_KEY"
fi

if [[ -e ~/src/python/tweets_analyzer/secrets.py ]]; then
    if grep xxxxxxxxxxxxxx ~/src/python/tweets_analyzer/secrets.py > /dev/null ; then
        if [[ ! -z "$TWITTER_CONSUMER_KEY" && ! -z "$TWITTER_CONSUMER_SECRET" \
            && ! -z "$TWITTER_ACCESS_TOKEN" && ! -z "$TWITTER_ACCESS_TOKEN_SECRET" ]]; then
            {
                echo 'consumer_key="'"$TWITTER_CONSUMER_KEY"'"'
                echo 'consumer_secret="'"$TWITTER_CONSUMER_SECRET"'"'
                echo 'access_token="'"$TWITTER_ACCESS_TOKEN"'"'
                echo 'access_token_secret="'"$TWITTER_ACCESS_TOKEN_SECRET"'"'
            } > ~/src/python/tweets_analyzer/secrets.py
        else
            echo "No configuration for twitter in ~/remnux-tools/config.cfg"
        fi
    fi
fi

{'fraction_non_alphanumeric': 0.14995523724261414, 'fraction_numerical': 0.004476275738585497, 'mean_word_length': 2.781725888324873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1810992', 'n_tokens_mistral': 903, 'n_tokens_neox': 851, 'n_words': 151}