コード例 #1
0
ファイル: views.py プロジェクト: ystone1025/info_consume
def sen_weibo_content():
    topic = request.args.get('topic', '')
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    sort_item = request.args.get('sort_item', 'timestamp')
    sen = request.args.get('sen', 0)
    sen = int(sen)
    #weibo_count = all_weibo_count(topic,start_ts,end_ts)
    results = get_weibo_content(topic, start_ts, end_ts, sort_item, sen)
    # print results
    return json.dumps(results)
コード例 #2
0
ファイル: views.py プロジェクト: ystone1025/info_consume
def weibo_content():
    topic = request.args.get('topic', '')
    during = request.args.get('pointInterval', 60 * 60)  # 默认查询时间粒度为3600秒
    during = int(during)
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    province = request.args.get('province', '')
    sort_item = request.args.get('sort_item', 'timestamp')
    weibo_content = get_weibo_content(topic, start_ts, end_ts, province,
                                      sort_item)
    return json.dumps(weibo_content)
コード例 #3
0
def weibo_content():
    topic = request.args.get('topic','')
    opinion0 = request.args.get('opinion','') # 默认查询时间粒度为3600秒
    opinion = '_'.join(opinion0.split(','))
    # print opinion,type(opinion[0]),
    # opinion1=["看客", "纹身", "高度", "人生", "健力宝"]
    # print opinion1,type(opinion1[0])
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    sort_item = request.args.get('sort_item','timestamp')
    weibo_content = get_weibo_content(topic,start_ts,end_ts,opinion,sort_item)
    return json.dumps(weibo_content)
コード例 #4
0
ファイル: views.py プロジェクト: SwoJa/ruman
def weibo_content():
    topic = request.args.get('topic','')
    if MYSQL_TOPIC_LEN == 0:
        topic = topic[:20]
    print topic
    during = request.args.get('pointInterval',60*60) # 默认查询时间粒度为3600秒
    during = int(during)
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    province = request.args.get('province','')
    sort_item = request.args.get('sort_item','timestamp')
    weibo_content = get_weibo_content(topic,start_ts,end_ts,province,sort_item)
    return json.dumps(weibo_content)
コード例 #5
0
ファイル: views.py プロジェクト: SwoJa/ruman
def sen_weibo_content():
    topic = request.args.get('topic','')
    if MYSQL_TOPIC_LEN == 0:
        topic = topic[:20]
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    sort_item = request.args.get('sort_item','timestamp')
    sen = request.args.get('sen',0)
    sen = int(sen)
    #weibo_count = all_weibo_count(topic,start_ts,end_ts)
    results = get_weibo_content(topic,start_ts,end_ts,sort_item,sen)
    # print results
    return json.dumps(results)
コード例 #6
0
ファイル: views.py プロジェクト: SwoJa/ruman
def weibo_content():
    topic = request.args.get('topic','')
    opinion0 = request.args.get('opinion','') # 默认查询时间粒度为3600秒
    # print 'opinion0::::::::::',opinion0
    opinion = '_'.join(opinion0.split(','))
    # print opinion,type(opinion[0]),
    # opinion1=["看客", "纹身", "高度", "人生", "健力宝"]
    # print opinion1,type(opinion1[0])
    end_ts = request.args.get('end_ts', '')
    end_ts = long(end_ts)
    start_ts = request.args.get('start_ts', '')
    start_ts = long(start_ts)
    sort_item = request.args.get('sort_item','timestamp')
    weibo_content = get_weibo_content(topic,start_ts,end_ts,opinion,sort_item)
    return json.dumps(weibo_content)