Exemplo n.º 1
0
 def parse_jianshu_notebooks(command):
     result = Match.jianshu_notebooks(command)
     notebooks_id = result.group('notebooks_id')
     task = SingleTask()
     task.kind = 'jianshu_notebooks'
     task.spider.href = 'http://www.jianshu.com/notebooks/{}/latest'.format(notebooks_id)  # config file???
     task.book.kind = 'jianshu_notebooks'
     task.book.sql.info = 'select * from jianshu_notebooks_info where notebooks_id = "{}"'.format(
         notebooks_id
     )
     task.book.sql.answer = 'select * from jianshu_article where href in (select href from ' + \
         'jianshu_notebooks_index where notebooks_id = "{}")'.format(notebooks_id)
     return task