|
@@ -154,7 +154,7 @@ def get_references(paper_id):
|
|
|
|
|
|
|
|
|
|
# 接口存在人机验证
|
|
# 接口存在人机验证
|
|
-def get_related_pages(paper_id):
|
|
|
|
|
|
+def get_related_papers(paper_id):
|
|
rsp = requests.get(url=f'https://www.semanticscholar.org/api/1/paper/{paper_id}/related-papers?limit=10&recommenderType=relatedPapers',
|
|
rsp = requests.get(url=f'https://www.semanticscholar.org/api/1/paper/{paper_id}/related-papers?limit=10&recommenderType=relatedPapers',
|
|
headers={'x-api-key': S2_API_KEY},
|
|
headers={'x-api-key': S2_API_KEY},
|
|
params={'fields': QUERY_FIELDS3})
|
|
params={'fields': QUERY_FIELDS3})
|
|
@@ -162,7 +162,7 @@ def get_related_pages(paper_id):
|
|
return rsp.json()['papers']
|
|
return rsp.json()['papers']
|
|
|
|
|
|
|
|
|
|
-def get_recommender_pages(paper_id):
|
|
|
|
|
|
+def get_recommended_papers(paper_id):
|
|
rsp = requests.get(url=f'https://api.semanticscholar.org/recommendations/v1/papers/forpaper/{paper_id}',
|
|
rsp = requests.get(url=f'https://api.semanticscholar.org/recommendations/v1/papers/forpaper/{paper_id}',
|
|
headers={'x-api-key': S2_API_KEY},
|
|
headers={'x-api-key': S2_API_KEY},
|
|
params={'fields': QUERY_FIELDS2})
|
|
params={'fields': QUERY_FIELDS2})
|
|
@@ -196,7 +196,7 @@ def fetch_data(paper_id):
|
|
# print(paper)
|
|
# print(paper)
|
|
data['citations'] = get_citations(paper_id)
|
|
data['citations'] = get_citations(paper_id)
|
|
data['references'] = get_references(paper_id)
|
|
data['references'] = get_references(paper_id)
|
|
- data['recommenderPages'] = get_recommender_pages(paper_id)
|
|
|
|
|
|
+ data['recommendedPapers'] = get_recommended_papers(paper_id)
|
|
|
|
|
|
return data if isinstance(data, dict) else None
|
|
return data if isinstance(data, dict) else None
|
|
|
|
|