spider_scheduler.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. class SpiderHome(object):
  8. @classmethod
  9. def run_xng_plus(cls):
  10. rule_dict1 = {
  11. "period": {"min": 365, "max": 365},
  12. "duration": {"min": 30, "max": 1800},
  13. "favorite_cnt": {"min": 0, "max": 0},
  14. "videos_cnt": {"min": 5000, "max": 0},
  15. "share_cnt": {"min": 0, "max": 0},
  16. }
  17. while True:
  18. XiaoNianGaoPlusRecommend(
  19. "recommend",
  20. "xiaoniangaoplus",
  21. "prod",
  22. rule_dict1,
  23. [64120158, 64120157, 63676778],
  24. )
  25. time.sleep(600)
  26. @classmethod
  27. def run_spss(cls):
  28. rule_dict = {
  29. "videos_cnt": {"min": 600, "max": 600},
  30. "play_cnt": {"min": 5000, "max": 5000}
  31. }
  32. SPSSRecommend(
  33. log_type="recommend",
  34. crawler="shipinshuashua",
  35. env="prod",
  36. rule_dict=rule_dict,
  37. our_uid=[66433018, 66433020, 66433022, 66433023, 66433024]
  38. )
  39. @classmethod
  40. def run_zfhybf(cls):
  41. # rule_dict = {
  42. # "videos_cnt": {"min": 600, "max": 600},
  43. # "play_cnt": {"min": 5000, "max": 5000}
  44. # }
  45. ZFHYBFRecommend(
  46. log_type="recommend",
  47. crawler="zhufuhaoyunbaofu",
  48. env="prod",
  49. rule_dict={},
  50. our_uid=[68560236, 68560235, 68560234, 68560233, 68560232, 68560231]
  51. )
  52. @classmethod
  53. def run_spss_id(cls):
  54. SPSSIdRecommend(
  55. env="prod"
  56. )