import json
with open('/root/gov_crawler/daily_crawl_config.json') as f:
    config = json.load(f)

new_entry = {
    'name': '汉川市-生态环境',
    'script': 'crawl_hanchuan_sthj.py',
    'incremental': True,
    'sync_mode': 'direct_server',
    'enabled': True,
    'group': '湖北',
    'note': '汉川市官网生态环境栏目, /c/hcs/sthj.jhtml, 分页sthj_N.jhtml, 24页355条, ul.news-list列表, article.htmledit_views正文'
}

config['crawlers'].append(new_entry)
config['count'] = len(config['crawlers'])
config['_count'] = len(config['crawlers'])

with open('/root/gov_crawler/daily_crawl_config.json', 'w') as f:
    json.dump(config, f, ensure_ascii=False, indent=2)

print(f'Added, total: {len(config["crawlers"])}')
