mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-14 23:16:50 +00:00
add bbwc.cn realtime
This commit is contained in:
28
rsshub/spiders/bbwc/realtime.py
Normal file
28
rsshub/spiders/bbwc/realtime.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import json
|
||||
import requests
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
|
||||
domain = 'https://api.bbwc.cn'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post['title']
|
||||
item['description'] = post['content']
|
||||
item['link'] = post['link']
|
||||
item['pubDate'] = post['inputtime']
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
url = f'{domain}/web/Newsflash/articlelist/l/{category}/device/30/appid/1/p/1/ps/100'
|
||||
posts = requests.get(url)
|
||||
print(posts)
|
||||
posts = json.loads(posts.text)['data']['list']
|
||||
return {
|
||||
'title': f'{category} - 即时新闻 - 商业周刊',
|
||||
'link': f'{domain}/realtime/index.html',
|
||||
'description': f'抓取彭博商业周刊即时新闻栏目的快讯',
|
||||
'author': 'hillerliao',
|
||||
'items': list(map(parse, posts))
|
||||
}
|
||||
Reference in New Issue
Block a user