mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-16 07:26:46 +00:00
show toefl word
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from rsshub.utils import fetch, filter_content
|
||||
from rsshub.utils import fetch, filter_content, DEFAULT_HEADERS
|
||||
|
||||
domain = 'https://www.prnewswire.com'
|
||||
|
||||
@@ -11,7 +11,9 @@ def parse(post):
|
||||
return item
|
||||
|
||||
def ctx(category=''):
|
||||
tree = fetch(f"{domain}/news-releases/financial-services-latest-news/earnings-list/?page=1&pagesize=100")
|
||||
# DEFAULT_HEADERS.update({'upgrade-insecure-requests': 1})
|
||||
url = f"{domain}/news-releases/financial-services-latest-news/earnings-list/?page=1&pagesize=100"
|
||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
||||
posts = tree.css('.card-list-hr .col-sm-8')
|
||||
items = list(map(parse, posts))
|
||||
items = filter_content(items)
|
||||
|
||||
2654
rsshub/spiders/word/toeflwords.txt
Normal file
2654
rsshub/spiders/word/toeflwords.txt
Normal file
File diff suppressed because it is too large
Load Diff
15
rsshub/spiders/word/word.py
Normal file
15
rsshub/spiders/word/word.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import random
|
||||
import linecache
|
||||
import sys
|
||||
from os import path
|
||||
|
||||
file_path = path.dirname(path.realpath(__file__))
|
||||
|
||||
def ctx():
|
||||
file = path.join(file_path,'toeflwords.txt')
|
||||
with open(file, encoding='utf-8') as inf:
|
||||
f = inf.readlines()
|
||||
count = len(f)
|
||||
wordnum = random.randrange(0, count, 1)
|
||||
word = linecache.getline(file, wordnum)
|
||||
return {"word": word}
|
||||
Reference in New Issue
Block a user