add home list

This commit is contained in:
hillerliao
2020-04-13 15:30:17 +08:00
parent ea01b359c1
commit 2027fd8c5a
4 changed files with 49 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
import requests
import json
from parsel import Selector
from rsshub.utils import DEFAULT_HEADERS
domain = 'https://www.weiyangx.com'
@@ -18,14 +19,11 @@ def parse(post):
def ctx():
url = f'https://www.weiyangx.com/wp-admin/admin-ajax.php'
q_data = {"action": "load_more_express",
"offset": "00",
"category": "29817",
"_ajax_nonce": "235111d38c"}
res = requests.post(url, data=q_data, headers=DEFAULT_HEADERS)
posts = json.loads(res.text)['expressList']
url = f'https://www.weiyangx.com/category/express'
res = requests.get(url, headers=DEFAULT_HEADERS)
res = Selector(res.text)
posts = res.css('script::text')[-4].extract().split('=')[-1]
posts = json.loads(posts)
items = list(map(parse, posts))
return {
'title': f'快讯 - 未央网',