#!/bin/bash

# This script will ganerate cache for default examples from the SPORE based 
# live domumentation to make it run faster even on during first time.

URL_ROOT=http://localhost/chemblws/

curl -g "${URL_ROOT}status.json"
curl -g "${URL_ROOT}status.xml"
curl -g "${URL_ROOT}compounds/CHEMBL1.json"
curl -g "${URL_ROOT}compounds/CHEMBL1.xml"
curl -g "${URL_ROOT}compounds/stdinchikey/QFFGVLORLPOAEC-SNVBAGLBSA-N.json"
curl -g "${URL_ROOT}compounds/stdinchikey/QFFGVLORLPOAEC-SNVBAGLBSA-N.xml"
curl -g "${URL_ROOT}compounds/smiles/COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56.json"
curl -g "${URL_ROOT}compounds/smiles/COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56.xml"
curl -X POST -d "smiles=COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56" ${URL_ROOT}compounds/smiles --header "Accept:application/json"
curl -X POST -d "smiles=COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56" ${URL_ROOT}compounds/smiles --header "Accept:text/xml"
curl -g "${URL_ROOT}compounds/substructure/CN(CCCN)c1cccc2ccccc12.json"
curl -g "${URL_ROOT}compounds/substructure/CN(CCCN)c1cccc2ccccc12.xml"
curl -X POST -d "smiles=CN(CCCN)c1cccc2ccccc12" ${URL_ROOT}compounds/substructure --header "Accept:application/json"
curl -X POST -d "smiles=CN(CCCN)c1cccc2ccccc12" ${URL_ROOT}compounds/substructure --header "Accept:text/xml"
curl -g "${URL_ROOT}compounds/similarity/COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56/85.json"
curl -g "${URL_ROOT}compounds/similarity/COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56/85.xml"
curl -X POST -d "smiles=COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56&simscore=85" ${URL_ROOT}compounds/similarity --header "Accept:application/json"
curl -X POST -d "smiles=COc1ccc2[C@@H]3[C@H](COc2c1)C(C)(C)OC4=C3C(=O)C(=O)C5=C4OC(C)(C)[C@@H]6COc7cc(OC)ccc7[C@H]56&simscore=85" ${URL_ROOT}compounds/similarity --header "Accept:text/xml"
curl -g "${URL_ROOT}compounds/CHEMBL2/image"
curl -g "${URL_ROOT}compounds/CHEMBL7/bioactivities.json"
curl -g "${URL_ROOT}compounds/CHEMBL7/bioactivities.xml"
curl -g "${URL_ROOT}compounds/CHEMBL278020/form.json"
curl -g "${URL_ROOT}compounds/CHEMBL278020/form.xml"
curl -g "${URL_ROOT}compounds/CHEMBL1642/drugMechanism.json"
curl -g "${URL_ROOT}compounds/CHEMBL1642/drugMechanism.xml"
curl -g "${URL_ROOT}targets.json"
curl -g "${URL_ROOT}targets.xml"
curl -g "${URL_ROOT}targets/CHEMBL1824.json"
curl -g "${URL_ROOT}targets/CHEMBL1824.xml"
curl -g "${URL_ROOT}targets/uniprot/Q13936.json"
curl -g "${URL_ROOT}targets/uniprot/Q13936.xml"
curl -g "${URL_ROOT}targets/CHEMBL2146303/bioactivities.json"
curl -g "${URL_ROOT}targets/CHEMBL2146303/bioactivities.xml"
curl -g "${URL_ROOT}targets/CHEMBL1824/approvedDrug.json"
curl -g "${URL_ROOT}targets/CHEMBL1824/approvedDrug.xml"
curl -g "${URL_ROOT}assays/CHEMBL1217643.json"
curl -g "${URL_ROOT}assays/CHEMBL1217643.xml"
curl -g "${URL_ROOT}assays/CHEMBL1217643/bioactivities.json"
curl -g "${URL_ROOT}assays/CHEMBL1217643/bioactivities.xml"
