Example #1
0
def newsemotion():
    counthandle = countHandle()
    selecttime = datetime.datetime.now() - datetime.timedelta(days=1)
    data = counthandle.listcount('rss_results', 'remotion', 'rpublished',
                                 selecttime)
    data = data[0:6]
    countword = []
    countvalue = []
    maxvalue = data[0][1]
    for item in data:
        countvalue.append(item[1])
        countword.append({'text': item[0], 'max': maxvalue})

    return jsonify(
        countword=countword,
        countvalue=countvalue,
    )
Example #2
0
def wechatemotion():
    counthandle = countHandle()
    selecttime = datetime.date.today() - datetime.timedelta(days=1)
    selecttime = selecttime.isoformat()
    data = counthandle.listcount('wechat_results', 'emotion', 'date',
                                 selecttime)
    data = data[0:6]
    countword = []
    countvalue = []
    maxvalue = data[0][1]
    for item in data:
        countvalue.append(item[1])
        countword.append({'text': item[0], 'max': maxvalue})

    return jsonify(
        countword=countword,
        countvalue=countvalue,
    )
Example #3
0
def newsemotion():
    counthandle = countHandle()
    selecttime = datetime.datetime.now()-datetime.timedelta(days=1)
    data = counthandle.listcount('rss_results', 'remotion', 'rpublished', selecttime)
    data = data[0:6]
    countword = []
    countvalue = []
    maxvalue = data[0][1]
    for item in data:
        countvalue.append(item[1])
        countword.append(
            {'text': item[0], 'max': maxvalue}
        )

    return jsonify(
        countword=countword,
        countvalue=countvalue,
    )
Example #4
0
def wechatemotion():
    counthandle = countHandle()
    selecttime = datetime.date.today()-datetime.timedelta(days=1)
    selecttime = selecttime.isoformat()
    data = counthandle.listcount('wechat_results', 'emotion', 'date', selecttime)
    data = data[0:6]
    countword = []
    countvalue = []
    maxvalue = data[0][1]
    for item in data:
        countvalue.append(item[1])
        countword.append(
            {'text': item[0], 'max': maxvalue}
        )

    return jsonify(
        countword=countword,
        countvalue=countvalue,
    )
Example #5
0
def newskeyword():
    counthandle = countHandle()
    selecttime = datetime.datetime.now() - datetime.timedelta(days=1)
    data = counthandle.listcount('rss_results', 'rtitle_keyword', 'rpublished',
                                 selecttime)
    countnum = 0
    countword = []
    countvalue = []
    for num in range(0, len(data)):
        countnum += data[num][1]
    for i in range(0, 9):
        if data[i][0].isdigit():
            data.pop(i)
    data = data[0:9]
    for item in data:
        countvalue.append(item[1])
        countword.append(item[0])
    return jsonify(countword=countword,
                   countvalue=countvalue,
                   countnum=countnum)
Example #6
0
def wechatkeyword():
    counthandle = countHandle()
    selecttime = datetime.datetime.today() - datetime.timedelta(days=1)
    selecttime = selecttime.isoformat()
    data = counthandle.listcount('wechat_results', 'title_keyword', 'date',
                                 selecttime)
    countnum = 0
    countword = []
    countvalue = []
    for num in range(0, len(data)):
        countnum += data[num][1]
    for i in range(0, 9):
        if data[i][0].isdigit():
            data.pop(i)
    data = data[0:9]
    for item in data:
        countvalue.append(item[1])
        countword.append(item[0])
    return jsonify(countword=countword,
                   countvalue=countvalue,
                   countnum=countnum)
Example #7
0
def newskeyword():
    counthandle = countHandle()
    selecttime = datetime.datetime.now()-datetime.timedelta(days=1)
    data = counthandle.listcount('rss_results', 'rtitle_keyword', 'rpublished', selecttime)
    countnum = 0
    countword = []
    countvalue = []
    for num in range(0, len(data)):
        countnum += data[num][1]
    for i in range(0, 9):
        if data[i][0].isdigit():
            data.pop(i)
    data = data[0:9]
    for item in data:
        countvalue.append(item[1])
        countword.append(item[0])
    return jsonify(
        countword=countword,
        countvalue=countvalue,
        countnum=countnum
    )
Example #8
0
def wechatkeyword():
    counthandle = countHandle()
    selecttime = datetime.datetime.today()-datetime.timedelta(days=1)
    selecttime = selecttime.isoformat()
    data = counthandle.listcount('wechat_results', 'title_keyword', 'date', selecttime)
    countnum = 0
    countword = []
    countvalue = []
    for num in range(0, len(data)):
        countnum += data[num][1]
    for i in range(0, 9):
        if data[i][0].isdigit():
            data.pop(i)
    data = data[0:9]
    for item in data:
        countvalue.append(item[1])
        countword.append(item[0])
    return jsonify(
        countword=countword,
        countvalue=countvalue,
        countnum=countnum
    )