12345678910111213141516171819202122232425262728293031 |
- class TopicGroup(object):
- """
- 生成topic,group, platform, mode等信息
- """
- def __init__(self):
- self.spider_list = [
- # ("test", "recommend", "test"),
- ("zhsdm", "recommend", "zhuhaoshiduomo"),
- ("fxs", "recommend", "fuxiaoshun"),
- ("zwwfsn", "recommend", "zhuwanwufusunew"),
- ('zjsjmn', 'recommend', 'zhujinshanjinmeinew'),
- ('hhxxzfdn', 'recommend', 'huanhuanxixizhufudaonew')
- ]
- def produce(self):
- """
- 工作代码
- :return: list [{}, {}, {}, {}, {}]
- """
- result = [
- {
- "topic": "{}_{}_prod".format(i[0], i[1]),
- "group": "{}_{}_prod".format(i[0], i[1]),
- "mode": i[1],
- "platform": i[2]
- } for i in self.spider_list
- ]
- return result
- # print(TopicGroup().produce())
|