MOO Builder

MOO Builder is a simple class that allows you to interface your PHP apps with the new MOO API to be able to bring your own unique designs to the world of MOO print products.  Want to sell MOO minicards through your site without having to get approved to be a featured designer on their site?  Not a problem.  With MOO Builder, it’s easy to let users buy designs that you specify with a quick redirect to the MOO store.  All of the information needed to create your products gets passed along transparently.

Basic Usage

1
2
3
4
5
6
7
<?php
require_once 'lib.moo.php';
$moo = new MOObuilder('[insert your API key here]');
$moo->addDesign($image);
$moo->setProductType('minicard');
$moo->redirect();
?>

Advanced Example (creating designs)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
require_once 'lib/lib.moo.php';
$moo = new MOObuilder('[insert your API key here]');
// We don't want to send the user to the "chooser" on MOO's page
$moo->isChooser(false); 
 
$d = new MOOdesign();
$d->addImage('http://ssdn.us/images/b4b_minicard.jpg');
$d->addText(array('string'=>'Blogs For Bands', 'bold'=>true, 'id'=>1));
$d->addText('WordPress Meets Music', 2);
$d->addText('http://blogsforbands.com', 3);
// I need to credit and link to the Creative Commons photo I used on the front.
$d->addText(array('string'=>'CC Photo by Bertrand http://is.gd/gMU', 'align'=>'right', 'id'=>6));
 
// We still have to add the design to the MOObuilder object.
// You can add as many designs as you need.
$moo->addDesign($d);
$moo->redirect();
?>

Downloads

Latest release: MOO Builder library
Example App: Basic – A simple app that lets you add and remove images from a list before sending them off to MOO.
Example App: Mosaic – Creates a “mosaic” out of a larger image by cropping an individual image into smaller chunks the size of MOO Minicards.
Example App: Rainbow Pack – Creates a pack of Minicards arranged by hue based on a Flickr user’s most interesting images.

Other Links

MOO Builder Subversion Repository
MOO API Information page

3 Comments

  • Bren says:

    Can’t get this to work.
    I’ve tried all the examples and every time it tries to redirect it just has value of null?

  • Hi Dan, I really like your idea, is it still working? could it be possible to have a demo somewhere? would love this :)

    • Dan says:

      Nicolas,

      I haven’t done anything with it in a while, but it should be working. MOO hasn’t updated their API since the most recent release. I don’t have any demos up (I should, but have been too busy). You should be able to drop the example applications on your PHP server and get them up and running pretty quickly.

Leave a Reply

Your email is never published nor shared. Required fields are marked *
*
*