mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-14 15:09:23 +00:00
remove some words
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'https://www.benzinga.com'
|
||||
|
||||
def ctx(category=''):
|
||||
|
||||
stock = category
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['description'] = item['title'] = stock.upper() + '的评级:' + ', '.join(post.css('td::text').extract())
|
||||
item['link'] = url
|
||||
return item
|
||||
|
||||
|
||||
url = f'{domain}/stock/{category}/ratings'
|
||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
||||
posts = tree.css('tbody tr')
|
||||
items = list(map(parse, posts))
|
||||
|
||||
column_title = tree.css('title::text').extract_first()
|
||||
return {
|
||||
'title': f'{column_title} - benzinga',
|
||||
'description': f'{column_title} - benzinga',
|
||||
'link': url,
|
||||
'author': f'hillerliao',
|
||||
'items': items
|
||||
}
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
from rsshub.utils import fetch
|
||||
|
||||
domain = 'https://www.benzinga.com'
|
||||
|
||||
def ctx(category=''):
|
||||
|
||||
stock = category
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['description'] = item['title'] = stock.upper() + '的评级:' + ', '.join(post.css('td::text').extract())
|
||||
item['link'] = url
|
||||
return item
|
||||
|
||||
|
||||
url = f'{domain}/stock/{category}/ratings'
|
||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
||||
posts = tree.css('tbody tr')
|
||||
items = list(map(parse, posts))
|
||||
|
||||
column_title = tree.css('title::text').extract_first()
|
||||
return {
|
||||
'title': f'{column_title} - benzinga',
|
||||
'description': f'{column_title} - benzinga',
|
||||
'link': url,
|
||||
'author': f'hillerliao',
|
||||
'items': items
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
from rsshub.utils import fetch
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
|
||||
domain = 'https://www.chaindd.com'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post.css('a::text').extract_first()
|
||||
item['description'] = post.css('p::text').extract_first()
|
||||
item['link'] = f"{domain}{post.css('a::attr(href)').extract_first()}"
|
||||
item['author'] = post.css('a.name::text').extract_first()
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
DEFAULT_HEADERS.update({'Referer': f'https://www.chaindd.com/column/{category}'})
|
||||
tree = fetch(f"{domain}/column/{category}")
|
||||
posts = tree.css('li .cont')
|
||||
return {
|
||||
'title': f'链得得栏目{category}最新文章',
|
||||
'link': f'{domain}/column/{category}',
|
||||
'description': f'链得得栏目{category}最新文章',
|
||||
'author': 'hillerliao',
|
||||
'items': list(map(parse, posts))
|
||||
from rsshub.utils import fetch
|
||||
from rsshub.utils import DEFAULT_HEADERS
|
||||
|
||||
domain = 'https://www.chaindd.com'
|
||||
|
||||
|
||||
def parse(post):
|
||||
item = {}
|
||||
item['title'] = post.css('a::text').extract_first()
|
||||
item['description'] = post.css('p::text').extract_first()
|
||||
item['link'] = f"{domain}{post.css('a::attr(href)').extract_first()}"
|
||||
item['author'] = post.css('a.name::text').extract_first()
|
||||
return item
|
||||
|
||||
|
||||
def ctx(category=''):
|
||||
DEFAULT_HEADERS.update({'Referer': f'https://www.chaindd.com/column/{category}'})
|
||||
tree = fetch(f"{domain}/column/{category}")
|
||||
posts = tree.css('li .cont')
|
||||
return {
|
||||
'title': f'链得得栏目{category}最新文章',
|
||||
'link': f'{domain}/column/{category}',
|
||||
'description': f'链得得栏目{category}最新文章',
|
||||
'author': 'hillerliao',
|
||||
'items': list(map(parse, posts))
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +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)
|
||||
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}
|
||||
@@ -1,3 +1,3 @@
|
||||
{% block content %}
|
||||
<h3>{{ word }}</h3>
|
||||
{% block content %}
|
||||
<h3>{{ word }}</h3>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user