Example #1
0
def getPostsByDate(pdate):
    if request.method == 'GET':
        return PostHandler().getPostsByDate(pdate)
    elif request.method == 'PUT':
        return PostHandler().updatePost(pdate, request.form)
    elif request.method == 'DELETE':
        return PostHandler().deletePost(pdate)
    else:
        return jsonify(Error="Method not allowed."), 405
Example #2
0
def getAllPosts():
    if request.method == 'POST':
        print("REQUEST: ", request.json)
        return PostHandler().insertPostJson(request.json)
    else:
        if not request.args:
            return PostHandler().getAllPosts()
        else:
            return PostHandler().searchPosts(request.args)
Example #3
0
def getPostsByUser(uid):
    return PostHandler().getPostsByUser(uid)
Example #4
0
def getAllPostsWebsite():
    return PostHandler().getAllPostWebsite()
Example #5
0
def addReaction(pid, reaction):
    if request.method == 'GET':
        print(reaction)
        return PostHandler().getReactionsByPost(pid, reaction)
    else:
        return jsonify(Error="Method not allowed."), 405
Example #6
0
def getNumberOfPostReplies():
    return PostHandler().getNumberOfPostReplies()
Example #7
0
def getRepliesPerDay():
    return PostHandler().getNumberOfRepliesPerDay()
Example #8
0
def postPost():
    return PostHandler().insertPost(request.json)
Example #9
0
def reply(post):
    return PostHandler().getAllReplies(post)
Example #10
0
def getNumberOfPostsPerDay():
    return PostHandler().getNumberOfPostsPerDay()
Example #11
0
def getActiveUsers():
    return PostHandler().getActiveUsers()
Example #12
0
def getPostsPerDayByUser(uid):
    return PostHandler().getPostsPerDayByUser(uid)
Example #13
0
def replyPost(pid):
    return PostHandler().insertPostReplyJson(request.json, pid)
Example #14
0
def getPostsByChatId(cid):
    return PostHandler().getPostsByChatId(cid)
Example #15
0
def insert():
    return PostHandler().insertPostJson(request.json)
Example #16
0
def getPostsByChatIdAndUser(cid, uid):
    return PostHandler().getPostsByChatIdAndUser(cid, uid)
Example #17
0
def postsByHashtag(cid, hashtag):
    return PostHandler().getPostsByHashtag(cid, hashtag)