Beispiel #1
0
def index():
    """返回页面
    """
    topic_name = request.args.get('query', default_topic_name) # 话题名
    news_id = request.args.get('news_id', default_news_id)
    topicid = em.getEventIDByName(topic_name)
    eventcomment = EventComments(topicid)

    news = News(news_id, topicid)
    news_subeventid = news.get_news_subeventid()
    news_url = news.get_news_url()

    comments = eventcomment.getNewsComments(news_id)
    if not comments:
        return 'no comments'

    return render_template('index/comment.html', topic=topic_name, topic_id=topicid, \
            news_id=news_id, news_subeventid=news_subeventid, news_url=news_url)
Beispiel #2
0
def index():
    """返回页面
    """
    topic_name = request.args.get('query', default_topic_name)  # 话题名
    news_id = request.args.get('news_id', default_news_id)
    topicid = em.getEventIDByName(topic_name)
    eventcomment = EventComments(topicid)

    news = News(news_id, topicid)
    news_subeventid = news.get_news_subeventid()
    news_url = news.get_news_url()

    comments = eventcomment.getNewsComments(news_id)
    if not comments:
        return 'no comments'

    return render_template('index/comment.html', topic=topic_name, topic_id=topicid, \
            news_id=news_id, news_subeventid=news_subeventid, news_url=news_url)
Beispiel #3
0
def index():
    """返回页面
    """
    topic_name = request.args.get('query', default_weibo_topic_name) # 话题名
    news_id = request.args.get('news_id', default_weibo_news_id)
    topicid = em.getEventIDByName(topic_name)
    cluster_num = request.args.get('cluster_num', default_cluster_num)
    cluster_eva_min_size = request.args.get('cluster_eva_min_size', default_cluster_eva_min_size)
    vsm = request.args.get('vsm', default_vsm)
    calculation_label = int(request.args.get('calcu', 1)) # 默认进行重新计算, 0表示从从已有结果数据文件加载数据

    news = News(news_id, topicid)
    news_subeventid = news.get_news_subeventid()
    if not news_subeventid:
        news_subeventid = 'None'
    eventcomment = EventComments(topicid)
    comments = eventcomment.getNewsComments(news_id)

    return render_template('index/weibo.html', topic=topic_name, topic_id=topicid, \
            news_id=news_id, news_subeventid=news_subeventid, cluster_num=cluster_num,\
            cluster_eva_min_size=cluster_eva_min_size, vsm=vsm, calc_label=calculation_label)
Beispiel #4
0
def index():
    """返回页面
    """
    topic_name = request.args.get('query', default_weibo_topic_name) # 话题名
    # topic_name = u'APEC2014-微博'
    news_id = request.args.get('news_id', default_weibo_news_id)
    topicid = em.getEventIDByName(topic_name)
    min_cluster_num = request.args.get('min_cluster_num', default_min_cluster_num)
    max_cluster_num = request.args.get('max_cluster_num', default_max_cluster_num)
    cluster_eva_min_size = request.args.get('cluster_eva_min_size', default_cluster_eva_min_size)
    vsm = request.args.get('vsm', default_vsm)

    news = News(news_id, topicid)
    news_subeventid = news.get_news_subeventid()
    if not news_subeventid:
        news_subeventid = 'None'
    eventcomment = EventComments(topicid)
    comments = eventcomment.getNewsComments(news_id)

    return render_template('index/weibo.html', topic=topic_name, topic_id=topicid, \
            news_id=news_id, news_subeventid=news_subeventid, min_cluster_num=min_cluster_num,\
            max_cluster_num=max_cluster_num, cluster_eva_min_size=cluster_eva_min_size, vsm=vsm)