Categories
residencies

James Bridle : residency part 1

I used Bookleteer’s Storycube API to make physical souvenirs of ebooks, as described in my post on Bookcubes. In this post I’ll run through the code used to manipulate Bkkeepr data and send it to the API.

Bkkeepr pulls a bunch of data out, which includes your username, the book cover image, the book’s title and author, the dates you started and finished reading it, and the number of bookmarks you made in it.

The Storycube API only accepts images, not text, so if you want text you’re going to have to build it into images. Here’s a useful piece of code for creating images with text on the fly, using the GD Graphics library which is built into most versions of PHP. It’s not pretty, but it’s useful for quick prototyping of data into images:

$im = @imagecreatetruecolor(156, 156)
or die(‘Cannot Initialize new GD image stream’);
$grey = imagecolorallocate($im, 231, 231, 231);
imagefilledrectangle($im, 0, 0, 156, 156, $grey);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 3, 10, 35, $title, $text_color);
imagestring($im, 3, 75, 50, ‘by’, $text_color);
imagestring($im, 3, 10, 65, $author, $text_color);
imagejpeg($im,’cubes/title-image.jpg’);
imagedestroy($im);

This code creates a new image of 156 x 156 pixels, colours it grey, then writes some text (“Title” by “Author”) in black across three lines, before saving the images to the ‘cubes’ directory, and wiping the temporary image. All these functions are well documented at http://php.net/manual/en/book.image.php – mostly, you just supply the text or colour for insertion, and a couple of reference points.

Exactly the same process is followed to write the start date, finish date (if applicable) and bookmarks panel:

$im = @imagecreatetruecolor(156, 156)
or die(‘Cannot Initialize new GD image stream’);
$grey = imagecolorallocate($im, 231, 231, 231);
imagefilledrectangle($im, 0, 0, 156, 156, $grey);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 3, 10, 30, ‘Started:’, $text_color);
imagestring($im, 3, 10, 45, $started, $text_color);
if ($finished !== ‘0000-00-00 00:00:00’) {
imagestring($im, 3, 10, 70, ‘Finished:’, $text_color);
imagestring($im, 3, 10, 85, $finished, $text_color);
}
imagestring($im, 3, 10, 105, ‘Bookmarks: ‘.$bookmarks_num, $text_color);
$im = imagerotate($im, 180, 0);
imagejpeg($im,’cubes/time-image.jpg’);
imagedestroy($im);

Note that here we also use imagerotate() to spin this panel 180° so that it’s the same orientation as the book cover panel.

The next step is to send the completed panels to the Storycube API. First we need to get an authentication token:

$username = ‘USERNAME’;
$password = ‘PASSWORD’;
$token = file_get_contents(‘http://generator.bookleteer.com/authenticate.html?username=’.$username.’&password=’.$password);

Then complete a request array, including the authentication token, and send this via curl to Bookleteer:

$fields=array(
‘token’=>$token,
‘author’=>$user,
‘title’=>$title.’ by ‘.$author,
‘creation_date’=>”,
‘num_images’=>’6’,
‘image_1’=>’@cubes/cover-image.jpg’,
‘image_2’=>’@cubes/title-image.jpg’,
‘image_3’=>’@cubes/time-image.jpg’,
‘image_4’=>’@cubes/bkkeepr-image.jpg’,
‘image_5’=>’@cubes/blank-image.jpg’,
‘image_6’=>’@cubes/blank-image.jpg’,
‘paper_size’=>’A4’,
‘design’=>’Diffusion’);

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,’http://generator.bookleteer.com/createStoryCube’);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS,$fields);
$result=curl_exec ($curl);
$content_type=curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
curl_close ($curl);

Note that the path to the images in the request array are prefaced by ‘@’ – this is because curl needs to upload the images to the remote server, and also means those need to be local paths: you can’t send a URL. All images to be sent need to be stored locally – which is done here by calling Amazon for the cover image and saving it locally (cubes/cover-image.jpg).

The Storycube API returns either a pdf, or an error code. So we check which it is via the content-type, and if all is well we save the file with a unique timestamp and offer it for download, or we print the error message:

if ($content_type == ‘application/pdf’) {
$filename = ‘bookcube-‘.time().’.pdf’;
$fp = fopen(‘cubes/’.$filename, ‘w’);
fwrite($fp, $result);
fclose($fp);
echo ‘Done: Download‘;
}
else {
echo $result;
}

And that’s it.
James Bridle, April 2010

Categories
residencies

Bookleteer Virtual Residencies

Since the alpha version of bookleteer went live last September we’ve been discussing with a number of friends and colleagues what we can do to demonstrate the API (Application Programming Interface) – which allows other applications, sites and systems to interface directly with the Generator, the engine behind bookleteer.com which generates the PDF files for eBooks & StoryCubes.

Following several years of successful residencies with writers and artists using the old Diffusion Generator to create and publish eBooks of their own, we decided to offer two ‘virtual residencies’ a year to creative individuals to play with the API and show what can be done with it – creating eBooks and StoryCubes from other data sets and web applications.

Our first two virtual residents are James Bridle and Simon Pope. James has already used the API to interface with his own project, bkkeepr to create ‘bookcubes’ (more details to follow in a separate post) and Simon is working on a project combining walking, cairns and StoryCubes.

Whilst bookleteer is in alpha, access to the API will be private – though we welcome people to get in touch who have a specific use in mind and would like to test it out. We’ll be commissioning two further virtual residencies later this year.

Categories
publishing on demand

Print On Demand eBooks arrive!

Our first batch of POD eBooks arrived and we’re very, very pleased with the results:

We’ll be sending out some samples to various friends, colleagues and bookleteers, meanwhile we will start accepting orders for POD eBooks & StoryCubes from April 12th. See the prior post on POD for our initial prices.

Categories
events publishing on demand

PU&P 9 Coventry with Artists and Makers

We will be running a Pitch Up & Publish event with Artists & Makers in Coventry on Friday 26th March 2010, from 12noon until 4pm as part of the Empty Shops Tour.

Come and join us to publish your stories, pictures and ideas as Diffusion eBooks and StoryCubes.

Date : Friday 26th March 2010
Time : 12pm to 4pm
Venue : 11 City Arcade, Coventry
Map

View bookleteer pitch up & publish in a larger map

Categories
publishing on demand updates & improvements

Print On Demand with bookleteer

Last week we passed another significant milestone for bookleteer – integrating a new set of templates that automatically render each eBook into a Print On Demand (POD) version. We’re sending the first 12 samples to be digitally printed as full colour A6 saddle-stitched booklets today and will post up some photos as soon as we get them back.

We’re also announcing our initial prices for the POD service (see below) which we hope will meet with approval. There are two POD options for eBooks, with a minimum print run of 50 copies :
Option A – for eBooks between 12 – 24 pages and,
Option B – for eBooks between 28 – 40 pages.

Option A prices start from around £3 per copy and go down to £1.61 per copy.
Option B prices start from around £4 per copy and go down to £2.29 per copy.
All prices include shipping within the UK. Please contact us for enquiries about larger quantities and overseas shipping. Turnaround time is expected to be 5-7 working days.

The StoryCube POD service has a minimum print run of 200 full colour cubes (single or double-sided), which can made up up of one or more StoryCube designs. Prices include VAT and shipping within the UK. Please contact us for enquiries about larger quantities and overseas shipping. Turnaround time is 5-7 working days.

Get in touch if you’d like to know more – we aim to start accepting POD orders after Easter.

Categories
events

PU&P 8 – Carlisle with Artists and Makers

We will be running a Pitch Up & Publish event with Artists & Makers in Carlisle on Friday 19th March 2010, from 12noon until 4pm as part of the Empty Shops Tour.

Come and join us to publish your stories, pictures and ideas as Diffusion eBooks and StoryCubes.

Date : Friday 19th March 2010
Time : 12pm to 4pm
Venue : 17 Lowther Arcade, Lowther Street, Carlisle, Cumbria CA3 8LX, UK
Map

View bookleteer pitch up & publish in a larger map

Categories
events

some eBooks from Shoreham

Some eBooks by Dan Thompson, Debbie Zoutewelle and Russ Bravo made at PU&P 7 in Shoreham-by-Sea on Friday.

Categories
events

PU&P 7 – Shoreham-by-Sea with Artists & Makers

We will be running a Pitch Up & Publish event with Artists & Makers in Shoreham-by-Sea on Friday 12th March 2010, from 12noon until 4pm as part of the Empty Shops Tour.

Come and join us to publish your stories, pictures and ideas as Diffusion eBooks and StoryCubes.

Date : Friday 12th March 2010
Time : 2pm to 4pm
Venue : 1a New Road, Shoreham-by-Sea, Sussex BN43 6RA
Map

View bookleteer places in a larger map

Categories
updates & improvements

HTML Content & Preview for eBooks Update

HTML content and page preview for eBooks has now been corrected to work properly. This means that content pasted or added directly into the HTML editing window in the eBook create/edit page will now flow into the eBook PDF file at the correct scale. The page preview function is also now working properly to help you see how content will flow across the eBook pages, so you can choose where to insert page breaks etc. To see how your content looks as landscape or portrait, change the ‘Orientation’ (from Landscape to Portrait etc), ‘Save Changes’ and click on ‘Preview Your HTML Content’.

Test it out and let us know your feedback!

bookleteer-html-preview

Categories
examples

Carnet du Bibliexplorateur

We received an email yesterday from a user based in Epinay sur Seine, France describing how he’s used bookleteer with his students:

My name is J.-Thomas Maillioux, and I’ve been working as the librarian for the collège Evariste Galois middle school since 2005. I’ve recently started to use the bookleteers to create “adventure books” for our first-year pupils’ library orientation program in a format both convenient and original. The flexibility of the Bookleteer publishing platform has also allowed me to quickly and easily implement the modifications suggested by my own observations, or advice from the students and teachers involved in the orientation program.

Download A4US Letter PDF 486Kb

I’ve also been able to sit down with small group of students to discuss what they would do with the Bookleteers : they suggested uses both for school (custom booklets for note taking on school trips, tutorials or HOWTOs for specific activities in sciences and technology classes, reminders while giving presentations in front of a class) and home (grocery shopping, tasks listing, books and stories writing or games) that make me think that, with the correct amount of support from their teachers in acquiring and supporting the necessary skills, they should be able to make the Bookleteers and the publishing platform their own relatively quickly : a good way to reconcile them not only with the printed word, but also with their printed word – that what they write, too, can be and deserves being made into a book with very little hassle.

We’d love to hear more testimonials of how bookleteer, the eBooks and StoryCubes are being used – please send your feedback to us at bookleteer at proboscis.org.uk