O3PO_Crossref
in package
Encapsulates the interface with the external service Crossref.
Provides methods to interface with Crossref.
Tags
Table of Contents
Methods
- generate_crossref_xml() : strong
- Make XML for registering a DOI at Crossref.
- get_cited_by_bibentries() : array<string|int, mixed>
- Get cited by information for a given DOI as an array of bibtenries.
- get_cited_by_xml_body() : mixed
- Retrieve cited-by information in xml format from Crossref.
- remote_post_meta_data_to_crossref() : mixed
- Http post meta data to Crossref.
- remote_get_cited_by() : mixed
- Retrieve cited-by information for a given doi from Crossref.
Methods
generate_crossref_xml()
Make XML for registering a DOI at Crossref.
public
static generate_crossref_xml(mixed $doi_batch_id, mixed $timestamp, string $title, mixed $title_mathml, mixed $abstract, mixed $abstract_mathml, mixed $number_authors, mixed $author_given_names, mixed $author_surnames, mixed $author_name_styles, mixed $author_orcids, mixed $author_affiliations, mixed $date_published, mixed $pages, mixed $doi, mixed $affiliations, mixed $journal, mixed $volume, mixed $parsed_bbl, mixed $post_url, mixed $pdf_pretty_permalink, mixed $number_award_numbers, mixed $award_numbers, mixed $funder_identifiers, mixed $funder_names, mixed $crossref_crossmark_policy_page_doi, mixed $email_address, mixed $publisher, mixed $eissn, mixed $crossref_archive_locations, mixed $journal_title, mixed $journal_level_doi_suffix, mixed $doi_prefix, mixed $site_url, mixed $orcid_url_prefix, mixed $license_url) : strong
Parameters
- $doi_batch_id : mixed
- $timestamp : mixed
- $title : string
-
The title of the work.
- $title_mathml : mixed
- $abstract : mixed
- $abstract_mathml : mixed
- $number_authors : mixed
- $author_given_names : mixed
- $author_surnames : mixed
- $author_name_styles : mixed
- $author_orcids : mixed
- $author_affiliations : mixed
- $date_published : mixed
- $pages : mixed
- $doi : mixed
- $affiliations : mixed
- $journal : mixed
- $volume : mixed
- $parsed_bbl : mixed
- $post_url : mixed
- $pdf_pretty_permalink : mixed
- $number_award_numbers : mixed
- $award_numbers : mixed
- $funder_identifiers : mixed
- $funder_names : mixed
- $crossref_crossmark_policy_page_doi : mixed
- $email_address : mixed
- $publisher : mixed
- $eissn : mixed
- $crossref_archive_locations : mixed
- $journal_title : mixed
- $journal_level_doi_suffix : mixed
- $doi_prefix : mixed
- $site_url : mixed
- $orcid_url_prefix : mixed
- $license_url : mixed
Tags
Return values
strong —XML for registering a DOI at Crossref
get_cited_by_bibentries()
Get cited by information for a given DOI as an array of bibtenries.
public
static get_cited_by_bibentries(string $crossref_url, string $crossref_id, string $crossref_pw, string $doi) : array<string|int, mixed>
Parameters
- $crossref_url : string
-
The url of the crossref server to upload to.
- $crossref_id : string
-
The id for which to submit this upload.
- $crossref_pw : string
-
The password corresponding to the crossref_id.
- $doi : string
-
The doi for which cited-by data is to be retrieved.
Tags
Return values
array<string|int, mixed> —Array of bibentries citing the given DOI
get_cited_by_xml_body()
Retrieve cited-by information in xml format from Crossref.
public
static get_cited_by_xml_body(string $crossref_url, string $crossref_id, string $crossref_pw, string $doi) : mixed
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
- $crossref_url : string
-
The url of the crossref server to upload to.
- $crossref_id : string
-
The id for which to submit this upload.
- $crossref_pw : string
-
The password corresponding to the crossref_id.
- $doi : string
-
The doi for which cited-by data is to be retrieved.
Tags
remote_post_meta_data_to_crossref()
Http post meta data to Crossref.
public
static remote_post_meta_data_to_crossref(string $doi_batch_id, string $crossref_xml, string $crossref_id, string $crossref_pw, string $crossref_url) : mixed
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
- $doi_batch_id : string
-
Batch id of this upload.
- $crossref_xml : string
-
The xml to upload.
- $crossref_id : string
-
The id for which to submit this upload.
- $crossref_pw : string
-
The password corresponding to the crossref_id.
- $crossref_url : string
-
The url of the crossref server to upload to.
Tags
remote_get_cited_by()
Retrieve cited-by information for a given doi from Crossref.
private
static remote_get_cited_by(string $crossref_url, string $crossref_id, string $crossref_pw, string $doi[, int $storage_time = 60 * 10 ][, int $timeout = 10 ]) : mixed
Uses Crossref's cited-by service.
Parameters
- $crossref_url : string
-
The url of the crossref server from which to fetch cited by information.
- $crossref_id : string
-
The id for which to submit this upload.
- $crossref_pw : string
-
The password corresponding to the crossref_id.
- $doi : string
-
The doi for which cited-by data is to be retrieved.
- $storage_time : int = 60 * 10
-
The maximal time for which to cache the response in a transient (default 600 seconds).
- $timeout : int = 10
-
Maximum time to wait for a response (default 6 seconds).
Tags
Return values
mixed —Response of wp_remote_get() from Crossref or WP_Error.