bclibraries/search-client

Client for searching Boston College Libraries API-enabled services

v1.0.2 2022-12-15 23:07 UTC

This package is auto-updated.

Last update: 2024-05-16 02:08:50 UTC


README

Perform parallel searches of API-enabled Boston College Libraries services.

Installation

Install with Composer:

composer require bclibraries/search-client:^1.0

Usage

See the examples directory for a complete example.

use \BCLib\SearchClient\Client;
use \BCLib\SearchClient\Services;

$services = [
    new Services\JesuitOnlineBibliographyService(),
    new Services\JesuitOnlineNecrologyService()
];

$client = new Client($services);
$responses = $client->search("paris");

foreach ($responses as $response) {

    // Link to search on Web.
    $search_url = $response->getWebSearchURL("paris");
    $total_count = $response->getTotalCount();
    
    // Iterate through the response items.
    foreach ($response->getItems() as $item) {
        $title = $item->getTitle();
        $item_url = $item->getUrl();
    }
}