Commit 15dbf721 authored by PkSM3's avatar PkSM3

[BUGFIX] demanding more fields in istex-api query

parent 1eab1ef8
...@@ -34,11 +34,13 @@ class ISTex(FileParser): ...@@ -34,11 +34,13 @@ class ISTex(FileParser):
try: try:
# print(path," ==> ",len(json_doc[path])) # print(path," ==> ",len(json_doc[path]))
hyperdata[key] = json_doc[path] hyperdata[key] = json_doc[path]
except: pass except:
pass
# print("|",hyperdata["language_iso3"]) # print("|",hyperdata["language_iso3"])
if "doi" in hyperdata: hyperdata["doi"] = hyperdata["doi"][0] if "doi" in hyperdata:
hyperdata["doi"] = hyperdata["doi"][0]
keywords = [] keywords = []
if "keywords" in hyperdata: if "keywords" in hyperdata:
...@@ -76,7 +78,10 @@ class ISTex(FileParser): ...@@ -76,7 +78,10 @@ class ISTex(FileParser):
if len(hyperdata["genre"])==0: if len(hyperdata["genre"])==0:
hyperdata.pop("genre") hyperdata.pop("genre")
if "language_iso3" in hyperdata: if "language_iso3" in hyperdata:
hyperdata["language_iso3"] = hyperdata["language_iso3"][0] if len(hyperdata["language_iso3"])>0:
hyperdata["language_iso3"] = hyperdata["language_iso3"][0]
else:
hyperdata["language_iso3"] = "eng"
RealDate = hyperdata["publication_date"] RealDate = hyperdata["publication_date"]
if "publication_date" in hyperdata: hyperdata.pop("publication_date") if "publication_date" in hyperdata: hyperdata.pop("publication_date")
......
...@@ -66,7 +66,7 @@ def getGlobalStatsISTEXT(request ): ...@@ -66,7 +66,7 @@ def getGlobalStatsISTEXT(request ):
print ("LOG::TIME:_ "+datetime.datetime.now().isoformat()+" query =", query ) print ("LOG::TIME:_ "+datetime.datetime.now().isoformat()+" query =", query )
print ("LOG::TIME:_ "+datetime.datetime.now().isoformat()+" N =", N ) print ("LOG::TIME:_ "+datetime.datetime.now().isoformat()+" N =", N )
query_string = query.replace(" ","+") query_string = query.replace(" ","+")
url = "http://api.istex.fr/document/?q="+query_string url = "http://api.istex.fr/document/?q="+query_string+"&output=id,title,abstract,pubdate,corpusName,authors,language"
tasks = MedlineFetcher() tasks = MedlineFetcher()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment