diff --git a/README.md b/README.md index 5015155..a66cb59 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # jkcrawler +*2019/10/24 更新:加入哔哩哔哩相簿* + 使用 Scrapy 写成的 JK 爬虫,图片源自哔哩哔哩、Tumblr、Instagram,以及微博、Twitter (待完成) 启动爬虫: diff --git a/genREADME.py b/genREADME.py index c77f974..9c1af3e 100644 --- a/genREADME.py +++ b/genREADME.py @@ -14,10 +14,16 @@ def genREADME(): '```shell script', ] - if not os.path.exists('config/'): - os.mkdir('config') - os.system('scrapy list > config/scrapylist.txt') - with open('config/scrapylist.txt') as f: + if os.path.exists('data/update.md'): + with open('data/update.md') as f: + update = f.read().rstrip() + head.insert(1, update) + head.insert(1, '') + + if not os.path.exists('data/'): + os.mkdir('data') + os.system('scrapy list > data/scrapylist.txt') + with open('data/scrapylist.txt') as f: spiders = f.read().splitlines() lines = ['scrapy crawl {spider} -o data/{spider}.jsonlines'.format(spider=spider) for spider in spiders]