<commit_before>from flask import render_template
from twython import Twython

from nonoshiri import app
from secret import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_SECRET

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/q/<query>')
def query(query):
    twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET,
                      ACCESS_TOKEN, ACCESS_SECRET)
    results = twitter.search(q=query)
    statuses = results['statuses']
    #results['search_metadata'].keys()
    #['since_id_str', 'max_id_str', 'count', 'completed_in',
    # 'refresh_url', 'query', 'max_id', 'since_id', 'next_results']
    return render_template('index.html',
                           statuses=statuses)<commit_msg>Route tidy up<commit_after>from flask import render_template, jsonify
from twython import Twython

from nonoshiri import app
from secret import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_SECRET

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/api/q/<query>')
def query(query):
    twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET,
                      ACCESS_TOKEN, ACCESS_SECRET)
    results = twitter.search(q=query)
    statuses = results['statuses']
    #results['search_metadata'].keys()
    #['since_id_str', 'max_id_str', 'count', 'completed_in',
    # 'refresh_url', 'query', 'max_id', 'since_id', 'next_results']
    return render_template('index.html',
                           statuses=statuses)
    #return jsonify(statuses)
{'fraction_non_alphanumeric': 0.12803676953381485, 'fraction_numerical': 0.0, 'mean_word_length': 4.06312292358804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6915507', 'n_tokens_mistral': 521, 'n_tokens_neox': 502, 'n_words': 102}