Documentation

O3PO_Ads
in package

Encapsulates the interface with the external service ads.

Provides methods to interface with ads.

Tags
subpackage

O3PO/includes

author

Christian Gogolin o3po@quantum-journal.org

Table of Contents

Methods

get_cited_by_bibentries()  : mixed
Get cited-by information as an array of O3PO_Bibentries.
bibcodes_to_query_url()  : mixed
Query url for detailed bibliographic data
get_cited_by_json()  : mixed
Get json encoded cited-by information.

Methods

get_cited_by_bibentries()

Get cited-by information as an array of O3PO_Bibentries.

public static get_cited_by_bibentries(string $ads_api_search_url, string $api_token, string $eprint[, mixed $storage_time = 60 * 60 * 12 ][, int $max_number_of_citations = 1000 ][, mixed $timeout = 10 ]) : mixed
Parameters
$ads_api_search_url : string

ADS api url.

$api_token : string

ADS API token.

$eprint : string

Eprint for which cited-by information is to be retrieved.

$storage_time : mixed = 60 * 60 * 12
$max_number_of_citations : int = 1000

Maximal number of citations to return.

$timeout : mixed = 10
Tags
since
0.3.0
access

public

Return values
mixed —

Cited-by information as an array of O3PO_Bibentries or WP_Error

bibcodes_to_query_url()

Query url for detailed bibliographic data

private static bibcodes_to_query_url(string $ads_api_search_url, array<string|int, mixed> $bibcodes, int $max_number_of_citations) : mixed

Construct the full query for retrieving detailed bibliographic data url from an array of bibcodes

Parameters
$ads_api_search_url : string

ADS api url.

$bibcodes : array<string|int, mixed>

Bibcodes for which to construct the query url.

$max_number_of_citations : int

Maximal number of citations to return.

Tags
sinde

0.3.0

access

private

get_cited_by_json()

Get json encoded cited-by information.

private static get_cited_by_json(string $ads_api_search_url, string $api_token, string $eprint[, mixed $storage_time = 60 * 60 * 12 ][, mixed $timeout = 6 ]) : mixed

Retrieves cited-by information in json format from ads.

Parameters
$ads_api_search_url : string

ADS api url.

$api_token : string

ADS API token.

$eprint : string

Eprint for which cited-by information is to be retrieved.

$storage_time : mixed = 60 * 60 * 12
$timeout : mixed = 6
Tags
since
0.3.0
access

private

Return values
mixed —

Json encoded cited-by information or a WP_Error in case of an error.


        
On this page

Search results