def subscription_timeline(): count = request.args.get('count', 20) offset = int(request.args.get('offset', 0)) papers = Subscription.get_timeline() if offset > len(papers): return jsonify(response=[], more=False) else: more = offset+count < len(papers) papers = papers[offset: offset+count] return jsonify(response=[paper.serialize() for paper in papers], more=more)
def update_subscription(): logging.info("Updating subscriptions.") Subscription.update_all()
def subscription_recommendations(): return Subscription.recommend()
def show_subscription(id): return Subscription.show(id)
def subscription_index(): subscriptions = Subscription.index() return jsonify(response=[x.serialize() for x in subscriptions])
def delete_subscription(id): return Subscription.delete(id)
def add_subscription(): return Subscription.add(request.args)