#!/usr/bin/python3

import json
import requests
import time
import os
from decimal import Decimal
from shutil import copyfile





start_time = time.time()

os.chdir("/var/www/html/covid-portal/scripts/publications")


greek_dois=[]


#Edit the metadata of the publications 
with open ('publications.json','r', encoding='utf-8') as f:
    data=json.load(f)
    data=data['data']
    for dat in data:
        greek_dois.append(dat['doi'])

with open('greek-dois-new.json', 'r') as infile:    
      greek_dois.extend(json.load(infile))

with open('greek-dois-all-all.json', 'w') as outfile:    
    json.dump(greek_dois, outfile)


print("--- %s minutes ---" % ((time.time() - start_time)/60))          
    

