From b29a24f79e1dbae3e30db06563498bcc4820a6ea Mon Sep 17 00:00:00 2001 From: Hiller Liao Date: Sun, 22 Dec 2024 16:09:51 +0800 Subject: [PATCH] modify bbwc realtime crawler --- rsshub/blueprints/main.py | 2 +- rsshub/spiders/bbwc/realtime.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index 4e143b1..9ecb97f 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -75,7 +75,7 @@ def ctolib_topics(category=''): from rsshub.spiders.ctolib.topics import ctx return render_template('main/atom.xml', **filter_content(ctx(category))) -@bp.route('/bbwc/realtime/') +@bp.route('/bbwc/realtime') def bbwc_realtime(category=''): from rsshub.spiders.bbwc.realtime import ctx return render_template('main/atom.xml', **filter_content(ctx(category))) diff --git a/rsshub/spiders/bbwc/realtime.py b/rsshub/spiders/bbwc/realtime.py index 56594ac..7f1936b 100644 --- a/rsshub/spiders/bbwc/realtime.py +++ b/rsshub/spiders/bbwc/realtime.py @@ -9,15 +9,15 @@ domain = 'https://api.bbwc.cn' def parse(post): item = {} item['title'] = post['title'] - item['description'] = post['content'] - item['link'] = post['link'] + item['description'] = post['outline'] + item['link'] = post['url'] item['pubDate'] = arrow.get(int(post['inputtime'])).isoformat() - item['author'] = 'Bloomberg' + item['author'] = 'Bloomberg' return item def ctx(category=''): - url = f'{domain}/web/Newsflash/articlelist/l/{category}/device/30/appid/1/p/1/ps/100' + url = f'https://api.bbwc.cn/web/home/articlelist/device/30/p/1' posts = requests.get(url) print(posts) posts = json.loads(posts.text)['data']['list']