Before you start
This tutorial is recommended for Ajax developers interested in complimenting their developer skills to better design Ajax pages by accessing Web APIs and parsing XML in their Ajax applications. Specifically, developers will access del.icio.us Web APIs to manage links and tags associated with their del.icio.us account.
This tutorial shows you how to use Ajax and a PHP proxy script to access del.icio.us Web APIs, all from a single "super page" that can be simulated as the home page to your Harry Potter book club. You'll make this page publicly available on the Internet so that your book club can gain traction and attract new members (as an aside, you may want to make it registration-based so that you have control over who adds links to your club). The del.icio.us APIs make this possible by allowing developers to create custom applications that allow users (such as yourself and the members of your book club) to manage tags and bookmarks directly in the club's del.icio.us account from the main club's page, without having to stray off to del.icio.us first, or click on a button in the browser.
This tutorial will help you do the following:
- Learn the del.icio.us way.
- Learn the various APIs available and test them from the browser.
- Design a super page using a table-free Web page design with a plethora of Ajax-friendly
- Develop a server-side proxy using PHP to handle del.icio.us API calls and to surf the Web.
- Parse XML returned as responses from del.icio.us API calls, and edit HTML within
divtags with the parsed data.
- Implement the following del.icio.us APIs in your super page:
- tags/get -- To retrieve tags from your del.icio.us account
- tags/rename -- To rename your tags
- posts/add -- To add new bookmarks directly into your del.icio.us account
- posts/get -- To retrieve bookmarks from your account associated with a tag you choose
- posts/delete -- To delete existing bookmarks from your account
All this API functionality is what makes it possible for your book club members to access a customizable Web page you create, while simultaneously adding bookmarks and tags to the club's del.icio.us account.
Beyond a text editor and a browser, you will need PHP and a Web server for your proxy:
- PHP -- You'll implement the proxy in PHP. Any version will do.
- Apache2 -- The Apache2 HTTP server is recommended as your server.
For an easy install on Windows® of both Apache2 and PHP, along with MySQL (not needed in this tutorial), see WampServer for their latest release.