skyzyx
5/6/2010 - 8:51 PM

gistfile1.php

<?php
include 'cloudfusion.class.php';
header('Content-type: text/html; charset=utf-8');

// Instantiate the PAS class
$pas = new AmazonPAS();

// Request the wishlist ID 'KAFYR57E8R81', returning the items in the wishlist.
$wishlist = $pas->list_lookup('KAFYR57E8R81', 'WishList', array(
    'ResponseGroup' => 'ListItems'
));

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
        <title>Wishlist Demo</title>
    </head>
    <body>
        <table border="1" cellpadding="5" cellspacing="0">
            <thead>
                <tr>
                    <th>Title</th>
                    <th>ASIN</th>
                    <th>Added</th>
                </tr>
            </thead>
            <tbody>
                <?php if (isset($wishlist->body->Lists->List->ListItem)): ?>
                    <?php foreach ($wishlist->body->Lists->List->ListItem as $item): ?>
                        <tr>
                            <td><?php echo (string) $item->Item->ItemAttributes->Title; ?></td>
                            <td><a href="http://www.amazon.com/dp/<?php echo (string) $item->Item->ASIN; ?>"><?php echo (string) $item->Item->ASIN; ?></a></td>
                            <td><?php echo date('j M Y', strtotime((string) $item->DateAdded)); ?></td>
                        </tr>
                    <? endforeach; ?>
                <? endif; ?>
            </tbody>
        </table>
    </body>
</html>