<commit_before>import json
import requests


class Metasmoke:
    @classmethod
    def send_stats_on_post(self, title, reasons):
        try:
            payload = {'post': {'title': title, 'reasons': reasons}}

            headers = {'Content-type': 'application/json'}
            requests.post("http://localhost:3000/posts.json", data=json.dumps(payload), headers=headers)
        except Exception as e:
            print e<commit_msg>Know that config thing? Let's actually use it :P<commit_after>import json
import requests
from globalvars import GlobalVars


class Metasmoke:
    @classmethod
    def send_stats_on_post(self, title, reasons):
        if GlobalVars.metasmoke_host is None:
            print "Metasmoke location not defined, not reporting"
            return

        try:
            payload = {'post': {'title': title, 'reasons': reasons}}

            headers = {'Content-type': 'application/json'}
            requests.post(GlobalVars.metasmoke_host + "/posts.json", data=json.dumps(payload), headers=headers)
        except Exception as e:
            print e
{'fraction_non_alphanumeric': 0.1070110701107011, 'fraction_numerical': 0.0036900369003690036, 'mean_word_length': 2.767361111111111, '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': '5233217', 'n_tokens_mistral': 300, 'n_tokens_neox': 292, 'n_words': 84}