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

from flask import Flask, request
from gevent import monkey; monkey.patch_socket()
from gevent.wsgi import WSGIServer
import redis

ps = redis.StrictRedis().pubsub()

app = Flask(__name__)

@app.route('/github', methods=['POST'])
def github():
    payload = request.form['payload']
    owner = payload['repository']['owner']['name']
    repo_name = owner + '/' + payload['repository']['name']
    repo_url = payload['repository']['url']
    headcommit = payload['commits'][0]
    commit_message = headcommit['message']
    author = headcommit['author']['name']

    message = '%s commited to %s: %s' % (author, repo_name, commit_message)

    print(message)
    
    ps.publish(repo_url, message)

if __name__ == '__main__':
    WSGIServer(('0.0.0.0', 8080), app).serve_forever()<commit_msg>debug mode for now<commit_after>#!/usr/bin/env python

from flask import Flask, request
from gevent import monkey; monkey.patch_socket()
from gevent.wsgi import WSGIServer
import redis

ps = redis.StrictRedis().pubsub()

app = Flask(__name__)
app.config['DEBUG'] = True

@app.route('/github', methods=['POST'])
def github():
    payload = request.form['payload']
    owner = payload['repository']['owner']['name']
    repo_name = owner + '/' + payload['repository']['name']
    repo_url = payload['repository']['url']
    headcommit = payload['commits'][0]
    commit_message = headcommit['message']
    author = headcommit['author']['name']

    message = '%s commited to %s: %s' % (author, repo_name, commit_message)

    print(message)
    
    ps.publish(repo_url, message)

if __name__ == '__main__':
    WSGIServer(('0.0.0.0', 8080), app).serve_forever()
{'fraction_non_alphanumeric': 0.16943127962085308, 'fraction_numerical': 0.01066350710900474, 'mean_word_length': 4.667785234899329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '51289', 'n_tokens_mistral': 571, 'n_tokens_neox': 542, 'n_words': 122}