]> Tony Duckles's Git Repositories (git.nynim.org) - delicious-utils.git/blob - delicious-dump/php-delicious/examples/simple-table/simple-table.php
delicious-dump: Handle changed XML output format
[delicious-utils.git] / delicious-dump / php-delicious / examples / simple-table / simple-table.php
1 <?php
2 require('../../php-delicious.inc.php');
3
4 define('DELICIOUS_USER', 'YOUR_USER');
5 define('DELICIOUS_PASS', 'YOUR_PASS');
6
7 $oDelicious = new PhpDelicious(DELICIOUS_USER, DELICIOUS_PASS);
8 ?>
9 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
10 <html lang="en">
11
12 <head>
13 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14 <title>Simple Table of All Posts</title>
15 <style type="text/css">
16 body { font-family: Arial, sans-serif; }
17 h1 { font-size: 121%; }
18 table { font-size: 92%; }
19 th { background: #ccc; padding: 7px; text-align: left; }
20 td { border-bottom: 1px solid #ccc; padding: 7px; }
21 </style>
22 </head>
23
24 <body>
25 <h1>Simple Table of All Posts</h1>
26 <?php if ($aPosts = $oDelicious->GetAllPosts()) { ?>
27 <p><?=count($aPosts) ?> posts in this account. Results cached for 10 seconds (by default).</p>
28 <table>
29 <tr>
30 <th>Description</th>
31 <th>Notes</th>
32 <th>Last Updated</th>
33 </tr>
34 <?php foreach ($aPosts as $aPost) { ?>
35 <tr>
36 <td><a href="<?=$aPost['url'] ?>"><?=$aPost['desc'] ?></a></td>
37 <td><?=$aPost['notes'] ?></td>
38 <td><?=$aPost['updated'] ?></td>
39 </tr>
40 <?php } ?>
41 </table>
42 <?php
43 } else {
44 echo $oDelicious->LastErrorString();
45 }
46 ?>
47 </body>
48
49 </html>