pipeline.py 618 B

1234567891011121314151617181920212223242526272829303132333435
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. from applications import WeixinSpider, PQMySQL
  6. class LongArticlesPipeline(object):
  7. """
  8. 长文管道, 对数据进行加工过滤
  9. """
  10. db_client = PQMySQL()
  11. @classmethod
  12. def checkAccountExists(cls, gh_id):
  13. """
  14. 校验账号是否已经抓过
  15. :param gh_id:
  16. :return:
  17. """
  18. sql = f"""
  19. INSERT
  20. """
  21. @classmethod
  22. def accountFilter(cls, account_info):
  23. """
  24. 账号过滤
  25. :param account_info:
  26. :return:
  27. """
  28. # 查询账号是否已经存在