Пример #1
0
def get_average_items():
    tags = request.args.getlist('tags')
    averageRatings = redis_functions.get_average_ratings(
        tags, globals.MAX_ITEMS_IN_ONE_SORT)
    print averageRatings
    results = redis_functions.get_items(averageRatings)
    return jsonify(items=results, state="success")
Пример #2
0
def get_active_channels():
    tags = request.args.getlist('tags')
    active_channels = redis_functions.get_activity(tags, 3)
    results = []
    for string in active_channels:
        categories = string.split("+")
        avg = redis_functions.get_average_ratings(categories, 2)
        results.append({'tags':categories, 'items':redis_functions.get_items(avg)})
    return jsonify(channels = results, state="success")
Пример #3
0
def get_active_channels():
    tags = request.args.getlist('tags')
    active_channels = redis_functions.get_activity(tags, 3)
    results = []
    for string in active_channels:
        categories = string.split("+")
        avg = redis_functions.get_average_ratings(categories, 2)
        results.append({
            'tags': categories,
            'items': redis_functions.get_items(avg)
        })
    return jsonify(channels=results, state="success")
Пример #4
0
def get_average_items():
    tags = request.args.getlist('tags')
    averageRatings = redis_functions.get_average_ratings(tags, globals.MAX_ITEMS_IN_ONE_SORT)
    print averageRatings
    results = redis_functions.get_items(averageRatings)
    return jsonify(items = results, state="success")