OxbridgeEconomics
commited on
Commit
·
d4c6492
1
Parent(s):
b37fb00
commit
Browse files
daily.py
CHANGED
@@ -14,7 +14,8 @@ from utils import (encode,
|
|
14 |
extract_from_pdf,
|
15 |
crawl,
|
16 |
datemodifier,
|
17 |
-
encode_content
|
|
|
18 |
|
19 |
with open('xpath.json', 'r', encoding='UTF-8') as f:
|
20 |
xpath_dict = json.load(f)
|
@@ -157,7 +158,7 @@ def crawl_eastmoney(url, article):
|
|
157 |
article['publishDate'] = datemodifier(article['publishDate'], xpath_dict[domain]['datetime_format'])
|
158 |
article['id'] = uuid.uuid5(uuid.NAMESPACE_OID, article['titleCN']+article['publishDate'])
|
159 |
article['sentimentScore'], article['sentimentLabel'] = sentiment_computation(contentCN.replace("\n",""))
|
160 |
-
|
161 |
|
162 |
today = datetime.today().strftime('%Y-%m-%d')
|
163 |
beginDate = (datetime.today() - timedelta(days=DELTA)).strftime('%Y-%m-%d')
|
|
|
14 |
extract_from_pdf,
|
15 |
crawl,
|
16 |
datemodifier,
|
17 |
+
encode_content,
|
18 |
+
update_content)
|
19 |
|
20 |
with open('xpath.json', 'r', encoding='UTF-8') as f:
|
21 |
xpath_dict = json.load(f)
|
|
|
158 |
article['publishDate'] = datemodifier(article['publishDate'], xpath_dict[domain]['datetime_format'])
|
159 |
article['id'] = uuid.uuid5(uuid.NAMESPACE_OID, article['titleCN']+article['publishDate'])
|
160 |
article['sentimentScore'], article['sentimentLabel'] = sentiment_computation(contentCN.replace("\n",""))
|
161 |
+
update_content(article)
|
162 |
|
163 |
today = datetime.today().strftime('%Y-%m-%d')
|
164 |
beginDate = (datetime.today() - timedelta(days=DELTA)).strftime('%Y-%m-%d')
|