Exemplo n.º 1
0
 def parse_jianshu_collection(command):
     result = Match.jianshu_collection(command)
     collection_id = result.group('collection_id')
     task = SingleTask()
     task.kind = 'jianshu_collection'
     task.spider.href = 'http://www.jianshu.com/collection/{}'.format(collection_id)
     task.book.kind = 'jianshu_collection'
     task.book.sql.info = 'select * from jianshu_collection_info where collection_fake_id = "{}"'.format(
         collection_id
     )
     task.book.sql.answer = 'select * from jianshu_article where href in (select href from ' + \
         'jianshu_collection_index where collection_fake_id = "{}")'.format(collection_id)
     return task