spider_scheduler.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import os
  2. import sys
  3. import time
  4. sys.path.append(os.getcwd())
  5. from spider.crawler_offline import *
  6. from spider.crawler_offline.shipinshuashua_id import SPSSIdRecommend
  7. from spider.crawler_offline.xiaoniangao_zhanghao import XiaoNianGaoZH
  8. class SpiderHome(object):
  9. @classmethod
  10. def run_xng_plus(cls):
  11. rule_dict1 = {
  12. "period": {"min": 365, "max": 365},
  13. "duration": {"min": 30, "max": 1800},
  14. "favorite_cnt": {"min": 0, "max": 0},
  15. "videos_cnt": {"min": 5000, "max": 0},
  16. "share_cnt": {"min": 0, "max": 0},
  17. }
  18. while True:
  19. XiaoNianGaoPlusRecommend(
  20. "recommend",
  21. "xiaoniangaoplus",
  22. "prod",
  23. rule_dict1,
  24. [64120158, 64120157, 63676778],
  25. )
  26. time.sleep(600)
  27. @classmethod
  28. def run_spss(cls):
  29. rule_dict = {
  30. "videos_cnt": {"min": 600, "max": 600},
  31. "play_cnt": {"min": 5000, "max": 5000}
  32. }
  33. SPSSRecommend(
  34. log_type="recommend",
  35. crawler="shipinshuashua",
  36. env="prod",
  37. rule_dict=rule_dict,
  38. our_uid=[66433018, 66433020, 66433022, 66433023, 66433024]
  39. )
  40. @classmethod
  41. def run_zfhybf(cls):
  42. # rule_dict = {
  43. # "videos_cnt": {"min": 600, "max": 600},
  44. # "play_cnt": {"min": 5000, "max": 5000}
  45. # }
  46. ZFHYBFRecommend(
  47. log_type="recommend",
  48. crawler="zhufuhaoyunbaofu",
  49. env="prod",
  50. rule_dict={},
  51. our_uid=[68560236, 68560235, 68560234, 68560233, 68560232, 68560231]
  52. )
  53. @classmethod
  54. def run_spss_id(cls):
  55. SPSSIdRecommend(
  56. env="prod"
  57. )
  58. @classmethod
  59. def run_xng_id(cls):
  60. XiaoNianGaoZH()