diff --git a/.lightly/settings.toml b/.lightly/settings.toml deleted file mode 100644 index 1a9fa50..0000000 --- a/.lightly/settings.toml +++ /dev/null @@ -1,6 +0,0 @@ - -title = "lightly settings" - -ports = [] - -[languages] diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index 0c48ddc..8629d51 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -55,6 +55,11 @@ def chuansongme_articles(category=''): 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/') +def bbwc_realtime(category=''): + from rsshub.spiders.bbwc.realtime import ctx + return render_template('main/atom.xml', **filter_content(ctx(category))) @bp.route('/infoq/recommend') diff --git a/rsshub/spiders/bbwc/realtime.py b/rsshub/spiders/bbwc/realtime.py new file mode 100644 index 0000000..d7ca62b --- /dev/null +++ b/rsshub/spiders/bbwc/realtime.py @@ -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)) + } \ No newline at end of file diff --git a/rsshub/templates/main/feeds.html b/rsshub/templates/main/feeds.html index e870f04..0d93678 100644 --- a/rsshub/templates/main/feeds.html +++ b/rsshub/templates/main/feeds.html @@ -42,6 +42,19 @@
+ +
+
+

Realtime - 彭博商业周刊

+
Realtime by hillerliao
+

举例:https://pyrsshub.vercel.app/bbwc/2

+

路由:/bbwc/:category

+

参数:category,分类,1 - 中文、2 - 英文

+
+
+
+ +