show chouti original url

This commit is contained in:
hillerliao
2022-04-23 22:16:26 +08:00
parent 6b034dd3e2
commit 2ed68734f3
2 changed files with 6 additions and 3 deletions

View File

@@ -28,4 +28,5 @@ RUN apk add --no-cache gcc musl-dev libxml2 libxslt-dev
RUN pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple some-package --no-cache-dir
# 启动nginx和uwsgi
ENTRYPOINT nginx -g "daemon on;" && uwsgi --ini /app/uwsgi.ini
# ENTRYPOINT nginx -g "daemon on;" && uwsgi --ini /app/uwsgi.ini
ENTRYPOINT nginx -g "daemon on;" && gunicorn -w 4 wsgi:app

View File

@@ -8,8 +8,10 @@ domain = 'https://dig.chouti.com'
def parse(post):
item = {}
item['title'] = re.sub(r'<[^>]*>', '', post['title']).strip()
item['description'] = post['title']
item['link'] = 'https://dig.chouti.com/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['link'] = post['originalUrl']
item['pubDate'] = str(post['created_time'])[0:10]
item['author'] = post['submitted_user']['nick']
return item