My favorites | Sign in
Project Home Wiki Issues
Search
for
webservice  
Web Service (alpha) for hackers and the curious
Updated Mar 6, 2012 by john.mie...@gmail.com

Introduction

Version 3.3.0 introduced a RESTful web service to OpenBook.

It permits you to create OpenBook HTML for a book that you can embed on any webpage, WordPress or otherwise. A sample client application demonstrates this. You can share the URL to the sample application on your website so that others can generate OpenBook HTML. You can also write other client applications that use the web service directly.

The web service is an alpha version, intended more for hackers and the curious. The only parameter is the book number. The templates and options are all hard-coded. The web service uses static styling and content elements that correspond to the default template 1.

This version still has a few bugs and I have since rolled back this feature. The most recent version of OpenBook does not have the web service. You can still download version 3.3.0 with the web service from the WordPress server, but it is recommend for experimentation only.

Web Service

The web service URL is located on your web server.

http://yourdomain.com/wp-content/plugins/openBook-book-data/ws/openBook-ws.php?booknumber=1896951422

Example:

http://bookreviews.johnmiedema.ca/wp-content/plugins/openbook-book-data/ws/openbook-ws.php?booknumber=1896951422

You can also prefix the book number with an Open Library ID (e.g., OLID:OL1397864M) or Library of Congress Classification Number (e.g., LCCN:93005405).

The service provides an XML response with the OpenBook HTML for the given book number.

Sample Client Application

The sample client application is located on your web server at:

http://yourdomain.com/wp-content/plugins/openBook-book-data/ws/SampleApp.php

Example:

http://bookreviews.johnmiedema.ca/wp-content/plugins/openbook-book-data/ws/SampleApp.php

The client provides simple application code for creating and calling the web service. The sample provides a useful function. It provides a web page interface for entering a book number, calling the web service, previewing the HTML, and showing the HTML response that can be copy-pasted into any web page. This is useful for embedding OpenBook HTML in web pages that cannot access the OpenBook plugin for WordPress.

You can write other client applications.


Sign in to add a comment
Powered by Google Project Hosting