diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index fc640f2..0f61007 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -109,4 +109,9 @@ def xuangubao_xuangubao(type='', category=''): @bp.route('/cls/subject/') def cls_subject(category=''): from rsshub.spiders.cls.subject import ctx + return render_template('main/atom.xml', **filter_content(ctx(category))) + +@bp.route('/chaindd/column/') +def chaindd_column(category=''): + from rsshub.spiders.chaindd.column import ctx return render_template('main/atom.xml', **filter_content(ctx(category))) \ No newline at end of file diff --git a/rsshub/spiders/chaindd/column.py b/rsshub/spiders/chaindd/column.py new file mode 100644 index 0000000..030baf7 --- /dev/null +++ b/rsshub/spiders/chaindd/column.py @@ -0,0 +1,24 @@ +from rsshub.utils import fetch + +domain = 'https://www.chaindd.com' + + +def parse(post): + item = {} + item['title'] = post.css('a::text').extract_first() + item['description'] = post.css('p::text').extract_first() + item['link'] = f"{domain}{post.css('a::attr(href)').extract_first()}" + item['author'] = post.css('a.name::text').extract_first() + return item + + +def ctx(category=''): + tree = fetch(f"{domain}/column/{category}") + posts = tree.css('li .cont') + return { + 'title': f'链得得栏目{category}最新文章', + 'link': f'{domain}/column/{category}', + 'description': f'链得得栏目{category}最新文章', + '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 f80dc50..196d22e 100644 --- a/rsshub/templates/main/feeds.html +++ b/rsshub/templates/main/feeds.html @@ -176,4 +176,17 @@
+ + +
+
+

链得得栏目动态

+
链得得栏目动态 by hillerliao
+

举例:https://rsshub-python.herokuapp.com/chaindd/column/3158465

+

路由:/chaindd/column/:category

+

参数:category [必填,见链得得栏目url中的数字编号]

+
+
+
+ {% endblock content %} \ No newline at end of file