\O3PO_Crossref

Encapsulates the interface with the external service Crossref.

Provides methods to interface with Crossref.

Summary

Methods
Properties
Constants
remote_post_meta_data_to_crossref()
get_cited_by_xml_body()
get_cited_by_bibentries()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
remote_get_cited_by()
No private properties found
N/A

Methods

remote_post_meta_data_to_crossref()

remote_post_meta_data_to_crossref(string  $doi_batch_id, string  $crossref_xml, string  $crossref_id, string  $crossref_pw, string  $crossref_url) 

Http post meta data to Crossref.

Submits meta-data in Crossref's xml format via http post to their servers.

From the command line one could do roughly the same with curl as follows:

curl -F 'operation=doMDUpload' -F 'login_id=XXXX' -F 'login_passwd=XXXX' -F 'fname=@/home/cgogolin/tmp/crossref-test.xml' https://test.crossref.org/servlet/deposit -v

Parameters

string $doi_batch_id

Batch id of this upload.

string $crossref_xml

The xml to upload.

string $crossref_id

The id for which to submit this upload.

string $crossref_pw

The password corresponding to the crossref_id.

string $crossref_url

The url of the crossref server to upload to.

get_cited_by_xml_body()

get_cited_by_xml_body(string  $crossref_url, string  $crossref_id, string  $crossref_pw, string  $doi) 

Retrieve cited-by information in xml format from Crossref.

Uses Crossref's cited-by service to retrieve information about works citing the given DOI in xml format.

See http://data.crossref.org/reports/help/schema_doc/crossref_query_output2.0/query_output2.0.html for more information.

Parameters

string $crossref_url

The url of the crossref server to upload to.

string $crossref_id

The id for which to submit this upload.

string $crossref_pw

The password corresponding to the crossref_id.

string $doi

The doi for which cited-by data is to be retrieved.

get_cited_by_bibentries()

get_cited_by_bibentries(string  $crossref_url, string  $crossref_id, string  $crossref_pw, string  $doi) : array

Get cited by information for a given DOI as an array of bibtenries.

Parameters

string $crossref_url

The url of the crossref server to upload to.

string $crossref_id

The id for which to submit this upload.

string $crossref_pw

The password corresponding to the crossref_id.

string $doi

The doi for which cited-by data is to be retrieved.

Returns

array —

Array of bibentries citing the given DOI

remote_get_cited_by()

remote_get_cited_by(string  $crossref_url, string  $crossref_id, string  $crossref_pw, string  $doi, integer  $storage_time = 60 * 10, integer  $timeout = 6) : mixed

Retrieve cited-by information for a given doi from Crossref.

Uses Crossref's cited-by service.

Parameters

string $crossref_url

The url of the crossref server from which to fetch cited by information.

string $crossref_id

The id for which to submit this upload.

string $crossref_pw

The password corresponding to the crossref_id.

string $doi

The doi for which cited-by data is to be retrieved.

integer $storage_time

The maximal time for which to cache the response in a transient (default 600 seconds).

integer $timeout

Maximum time to wait for a response (default 6 seconds).

Returns

mixed —

Response of wp_remote_get() from Crossref or WP_Error.