modify bbwc realtime crawler

This commit is contained in:
Hiller Liao
2024-12-22 16:09:51 +08:00
parent fe68aa7f68
commit b29a24f79e
2 changed files with 5 additions and 5 deletions

View File

@@ -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/<string:category>')
@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)))

View File

@@ -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']