mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-16 23:16:49 +00:00
Merge branch 'master' of https://github.com/hillerliao/Rsshub-Python
This commit is contained in:
@@ -10,6 +10,7 @@ def ctx(category=''):
|
|||||||
def parse(post):
|
def parse(post):
|
||||||
item = {}
|
item = {}
|
||||||
item['description'] = item['title'] = stock.upper() + '的评级:' + ', '.join(post.css('td::text').extract())
|
item['description'] = item['title'] = stock.upper() + '的评级:' + ', '.join(post.css('td::text').extract())
|
||||||
|
item['link'] = url
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ def parse(post):
|
|||||||
item['title'] = post['article_title']
|
item['title'] = post['article_title']
|
||||||
item['description'] = f"{post['article_summary']}<br><img referrerpolicy='no-referrer' src={post.get('article_cover')}>"
|
item['description'] = f"{post['article_summary']}<br><img referrerpolicy='no-referrer' src={post.get('article_cover')}>"
|
||||||
item['link'] = f"{domain}/article/{post['uuid']}"
|
item['link'] = f"{domain}/article/{post['uuid']}"
|
||||||
|
item['pubDate'] = post['publish_time']
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ def ctx(category=''):
|
|||||||
|
|
||||||
posts = json.loads(posts.text)['data']
|
posts = json.loads(posts.text)['data']
|
||||||
return {
|
return {
|
||||||
'title': f'{category} - topic - infoq',
|
'title': f'{category} - Topic - InfoQ',
|
||||||
'link': referer,
|
'link': referer,
|
||||||
'description': 'InfoQ - 促进软件开发领域知识与创新的传播',
|
'description': 'InfoQ - 促进软件开发领域知识与创新的传播',
|
||||||
'author': 'hillerliao',
|
'author': 'hillerliao',
|
||||||
|
|||||||
@@ -1,21 +1,27 @@
|
|||||||
from rsshub.utils import DEFAULT_HEADERS
|
from rsshub.utils import DEFAULT_HEADERS
|
||||||
from rsshub.utils import fetch
|
import requests
|
||||||
|
import json
|
||||||
|
from parsel import Selector
|
||||||
|
|
||||||
domain = 'https://www.weiyangx.com'
|
domain = 'https://www.weiyangx.com'
|
||||||
|
|
||||||
|
|
||||||
def parse(post):
|
def parse(post):
|
||||||
item = {}
|
item = {}
|
||||||
item['title'] = post.css('h2::text').extract_first()
|
item['title'] = post['post_title']
|
||||||
item['description'] = post.css('p::text').extract_first()
|
item['description'] = post['post_content']
|
||||||
item['link'] = post.css('a::attr(href)').extract_first()
|
post_id = post['post_id']
|
||||||
|
item['link'] = f'{domain}/{post_id}.html'
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
def ctx(category=''):
|
def ctx(category=''):
|
||||||
url = f'https://www.weiyangx.com/tag/{category}'
|
url = f'https://www.weiyangx.com/tag/{category}'
|
||||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
res = requests.get(url, headers=DEFAULT_HEADERS)
|
||||||
posts = tree.css('.category-post-node')
|
res = Selector(res.text)
|
||||||
|
posts = res.css('script::text')[-4].extract().split('=')[-1]
|
||||||
|
posts = json.loads(posts)
|
||||||
|
# posts = tree.css('script::text')[-5].extract().split('=')[-1]
|
||||||
items = list(map(parse, posts))
|
items = list(map(parse, posts))
|
||||||
return {
|
return {
|
||||||
'title': f'{category} - 文章 - 未央网',
|
'title': f'{category} - 文章 - 未央网',
|
||||||
|
|||||||
Reference in New Issue
Block a user