示例#1
0
    def deal_article_dynamic_info(self, req_data, text):
        """
        取文章动态信息 阅读 点赞 评论
        :param req_data: post 请求的data str格式
        :param text:
        :return:
        """
        data = tools.get_json(text)

        dynamic_data = dict(
            sn=tools.get_param(req_data, "sn"),
            __biz=tools.get_param(req_data, "__biz").replace("%3D", "="),
            read_num=data.get("appmsgstat", {}).get("read_num"),
            like_num=data.get("appmsgstat", {}).get("like_num"),
            comment_count=data.get("comment_count"),
            spider_time=tools.get_current_date(),
        )

        if dynamic_data:
            data_pipeline.save_article_dynamic(dynamic_data)
示例#2
0
    def deal_article_dynamic_info(self, req_data, text):
        """
        取文章动态信息 阅读 点赞 评论
        :param req_data: post 请求的data str格式
        :param text:
        :return:
        """
        data = tools.get_json(text)

        dynamic_data = dict(
            sn=tools.get_param(req_data, 'sn'),
            __biz=tools.get_param(req_data, '__biz').replace('%3D', '='),
            read_num=data.get('appmsgstat', {}).get('read_num'),
            like_num=data.get('appmsgstat', {}).get('like_num'),
            comment_count=data.get('comment_count'),
            spider_time=tools.get_current_date()
        )

        if dynamic_data:
            data_pipeline.save_article_dynamic(dynamic_data)