[use]
plugin = basics
plugin = conditor
plugin = lodex
[env]
path = currentDate
value = thru(() => new Date()).thru(d => d.getDay()).thru(i => ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'][i]).thru(m => env('Startup') ? 'Startup' : m)
;
;
; Notices de 2015 :
; - ayant au moins un auteur ayant indiqué le CNRS
; - présentes au moins deux fois dans HAL
;
; le fichier généré au format TSV compatible Excel
;
;
[replace]
path = q
value = fix('business.authorsAddresses:(cnrs OR insu OR ins2i) AND (host.publicationDate.normalized:2015 OR host.electronicPublicationDate.normalized:2015) AND (business.sourceUidChain:*\\!hal\\$*\\!hal\\$*)')
[CORHALFetch]
url = https://corhal-api.inist.fr
retries = 3
timeout = 60000
[replace]
path = url
value = get('business.sourceUidChain').prepend('https://corhal-api.inist.fr/mergedDocuments/')
[URLFetch]
url = get('url')
json = true
target = result
timeout = 60000
noerror = true
[assign]
path = result.doublons
value = get('result.sourceUids').filter(i => (i.indexOf('hal') === 0)).map(i => i.replace(/^hal\$/, 'https://hal.archives-ouvertes.fr/'))
[exchange]
value = get('result').omit(['authors', 'origins', 'business', 'files', 'keywords', 'enrichments', 'classifications', 'funders', 'sourceUids', 'abstract' ])
[OBJFlatten]
separator = /
[objects2columns]
[OBJStandardize]
[CSVString]
format = strict
separator = fix('\t')
[FILESave]
location = fix(`${env('PWD')}/public/${env('FileName')}`)
identifier = fix(`${env('FileName')}-${env('currentDate')}.tsv`)
compress = true
[exchange]
value = get('filename').append(' generated.')
[dump]
indent = true