mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-22 07:26:48 +00:00
set chouti item url to original url
This commit is contained in:
@@ -10,7 +10,6 @@ def parse(post):
|
|||||||
item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip()
|
item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip()
|
||||||
chouti_link = domain + '/link/' + str(post['id'])
|
chouti_link = domain + '/link/' + str(post['id'])
|
||||||
item['description'] = post['title'] + '<br /> <br />' + f'<a href="{chouti_link}" target="_blank">抽屉链接</a>'
|
item['description'] = post['title'] + '<br /> <br />' + f'<a href="{chouti_link}" target="_blank">抽屉链接</a>'
|
||||||
|
|
||||||
item['link'] = post['originalUrl']
|
item['link'] = post['originalUrl']
|
||||||
item['pubDate'] = str(post['created_time'])[0:10]
|
item['pubDate'] = str(post['created_time'])[0:10]
|
||||||
item['author'] = post['submitted_user']['nick']
|
item['author'] = post['submitted_user']['nick']
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
|
import re
|
||||||
import requests
|
import requests
|
||||||
from rsshub.utils import DEFAULT_HEADERS
|
from rsshub.utils import DEFAULT_HEADERS
|
||||||
|
|
||||||
domain = 'https://dig.chouti.com'
|
domain = 'https://dig.chouti.com'
|
||||||
|
|
||||||
|
|
||||||
def parse(post):
|
def parse(post):
|
||||||
item = {}
|
item = {}
|
||||||
item['title'] = post['title']
|
item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip()
|
||||||
item['description'] = f"[{post['sectionName']}] {item['title']} "
|
chouti_link = domain + '/link/' + str(post['id'])
|
||||||
item['link'] = 'https://dig.chouti.com/link/' + str(post['id'])
|
item['description'] = post['title'] + '<br /> <br />' + f'<a href="{chouti_link}" target="_blank">抽屉链接</a>'
|
||||||
|
item['link'] = post['originalUrl']
|
||||||
item['pubDate'] = str(post['created_time'])[0:10]
|
item['pubDate'] = str(post['created_time'])[0:10]
|
||||||
item['author'] = post['submitted_user']['nick']
|
item['author'] = post['submitted_user']['nick']
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
def ctx(category=''):
|
def ctx(category=''):
|
||||||
DEFAULT_HEADERS.update({'Referer': domain})
|
DEFAULT_HEADERS.update({'Referer': domain})
|
||||||
post_data = {'sectionId':category}
|
post_data = {'sectionId':category}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import re
|
||||||
import requests
|
import requests
|
||||||
from rsshub.utils import DEFAULT_HEADERS
|
from rsshub.utils import DEFAULT_HEADERS
|
||||||
|
|
||||||
@@ -6,9 +7,10 @@ domain = 'https://dig.chouti.com'
|
|||||||
|
|
||||||
def parse(post):
|
def parse(post):
|
||||||
item = {}
|
item = {}
|
||||||
item['title'] = post['title']
|
item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip()
|
||||||
item['description'] = f"{item['title']} "
|
chouti_link = domain + '/link/' + str(post['id'])
|
||||||
item['link'] = 'https://dig.chouti.com/link/' + str(post['id'])
|
item['description'] = post['title'] + '<br /> <br />' + f'<a href="{chouti_link}" target="_blank">抽屉链接</a>'
|
||||||
|
item['link'] = post['originalUrl']
|
||||||
item['pubDate'] = str(post['created_time'])[0:10]
|
item['pubDate'] = str(post['created_time'])[0:10]
|
||||||
item['author'] = post['submitted_user']['nick']
|
item['author'] = post['submitted_user']['nick']
|
||||||
return item
|
return item
|
||||||
|
|||||||
@@ -321,7 +321,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h4 class="card-title">抽屉新热榜 - 用户</h4>
|
<h4 class="card-title">抽屉新热榜 - 用户</h4>
|
||||||
<h6 class="text-muted">抽屉新热榜 - 用户 <a href="https://github.com/hillerliao" target="_blank" class="badge badge-secondary">by hillerliao</a></h6>
|
<h6 class="text-muted">抽屉新热榜 - 用户 <a href="https://github.com/hillerliao" target="_blank" class="badge badge-secondary">by hillerliao</a></h6>
|
||||||
<p class="card-text">举例:<a href="https://rsshub.deta.dev/chouti/user/61675332140" target="_blank">https://rsshub.deta.dev/chouti/user/61675332140</a></p>
|
<p class="card-text">举例:<a href="https://rsshub.deta.dev/chouti/user/wb_5517143496" target="_blank">https://rsshub.deta.dev/chouti/user/wb_5517143496</a></p>
|
||||||
<p class="card-text">路由:<code>/chouti/user/:category</code></p>
|
<p class="card-text">路由:<code>/chouti/user/:category</code></p>
|
||||||
<p class="card-text">参数:category [必填, 用户id] </p>
|
<p class="card-text">参数:category [必填, 用户id] </p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user