import requests
from templates.text import TextTemplate
from random import choice
import json
import config

def process(input, entities=None):
    output = {}
    try:
        '''
        # Programming quotes
        r = requests.get('http://quotes.stormconsultancy.co.uk/random.json')
        data = r.json()
        output['input'] = input
        output['output'] = TextTemplate(data['quote'] + ' - ' + data['author']).get_message()
        output['success'] = True
        '''
        with open(config.QUOTES_SOURCE_FILE) as quotes_file:
            quotes = json.load(quotes_file)
            quotes_list = quotes['quotes']
            output['input'] = input
            output['output'] = TextTemplate(choice(quotes_list)).get_message()
            output['success'] = True
    except:
        output['success'] = False
    return output

@@ -49,16 +49,68 @@
 emplate%0A
+from templates.quick_replies import add_quick_reply%0A
 from ran
@@ -691,110 +691,752 @@
     
-output%5B'input'%5D = input%0A            output%5B'output'%5D = TextTemplate(choice(quotes_list)).get_message()
+message = TextTemplate(choice(quotes_list)).get_message()%0A            postback_quote = %7B%0A                'intent': 'quote',%0A                'entities': None%0A            %7D%0A            postback_fact = %7B%0A                'intent': 'fact',%0A                'entities': None%0A            %7D%0A            postback_joke = %7B%0A                'intent': 'joke',%0A                'entities': None%0A            %7D%0A            message = add_quick_reply(message, 'Another one!', json.dumps(postback_quote))%0A            message = add_quick_reply(message, 'Show me a fact.', json.dumps(postback_fact))%0A            message = add_quick_reply(message, 'Tell me a joke.', json.dumps(postback_joke))%0A            output%5B'input'%5D = input%0A            output%5B'output'%5D = message
 %0A   

Add quick replies (#211)