PHP Classes

File: examples/WhatWork.php

Recommend this page to a friend!
  Classes of Robert van der Linde   LibraryThing Services   examples/WhatWork.php   Download  
File: examples/WhatWork.php
Role: Example script
Content type: text/plain
Description: example for WhatWork
Class: LibraryThing Services
Get book information using the LibraryThing API
Author: By
Last change:
Date: 14 years ago
Size: 660 bytes
 

Contents

Class file image Download
<?php
/**
 * Instantiate the webservice
 */
$service = new WhatWorkService();

/**
 * Will dump out an associative array
 * array( 'link' => 'http://a_link_to_the.librarything.work/',
 * 'work' => 'a_work_id');
 */
var_dump($service->getWorkInformation(array(WhatWorkService::PARAMETER_AUTHOR => 'Tom Clancy')));

/**
 * Will return the link to the book identified by isbn 0001010192
 */
$link = $service->getWorkLink(array(WhatWorkService::PARAMETER_ISBN => '001010192'));

/**
 * Will return the work id for the first book found with the title "Art of war"
 */
$workId = $service->getWorkId(array(WhatWorkService::PARAMETER_TITLE => 'Art of war'));
?>