diff options
| author | Mohamed Elashri <muhammadelashri@gmail.com> | 2022-09-30 23:06:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-30 23:06:54 +0000 |
| commit | 8d5653e60d5299979c0de5e55b1c5ca0bee8190c (patch) | |
| tree | 8dc02b7663a5c9c91b09483e4499a612d9823698 /searx/engines/springer.py | |
| parent | 212c98c9f55dc602f57b4f01a73192450e9782b7 (diff) | |
| parent | 62324655ff0d2e6f234b3e31413877b4b4a7a9fa (diff) | |
Merge branch 'searxng:master' into master
Diffstat (limited to 'searx/engines/springer.py')
| -rw-r--r-- | searx/engines/springer.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/searx/engines/springer.py b/searx/engines/springer.py index e5255b794..a4d0832d8 100644 --- a/searx/engines/springer.py +++ b/searx/engines/springer.py @@ -41,7 +41,6 @@ def response(resp): json_data = loads(resp.text) for record in json_data['records']: - content = record['abstract'] published = datetime.strptime(record['publicationDate'], '%Y-%m-%d') authors = [" ".join(author['creator'].split(', ')[::-1]) for author in record['creators']] tags = record.get('genre') @@ -50,20 +49,24 @@ def response(resp): results.append( { 'template': 'paper.html', - 'title': record['title'], 'url': record['url'][0]['value'].replace('http://', 'https://', 1), - 'type': record.get('contentType'), - 'content': content, + 'title': record['title'], + 'content': record['abstract'], + 'comments': record['publicationName'], + 'tags': tags, 'publishedDate': published, + 'type': record.get('contentType'), 'authors': authors, - 'doi': record.get('doi'), + # 'editor': '', + 'publisher': record.get('publisher'), 'journal': record.get('publicationName'), - 'pages': record.get('start_page') + '-' + record.get('end_page'), - 'tags': tags, - 'issn': [record.get('issn')], - 'isbn': [record.get('isbn')], 'volume': record.get('volume') or None, + 'pages': '-'.join([x for x in [record.get('startingPage'), record.get('endingPage')] if x]), 'number': record.get('number') or None, + 'doi': record.get('doi'), + 'issn': [x for x in [record.get('issn')] if x], + 'isbn': [x for x in [record.get('isbn')] if x], + # 'pdf_url' : '' } ) return results |