The third of the videos coming with my "REST in Delphi 2010 White Paper" is focused on building a client for Google's Spreadsheet API, and let's you publish a database table in a Google Document. From the white paper:
The Web Services interface for Google Docs lets you upload and download (and even convert) web documents and manage their access credentials, which is certainly quite nice. But, there is also one interface that lets you work with the content of a given document on the web: this is the Google Spreadsheet Services API, still in an early beta at the time of writing.
Using this API you can access individual cells of any sheet of any spreadsheet that is either private or public on the system. Anyone looking at those documents with a web interface will see them change in real time!
As this API (like many other Google APIs) allows access to personal and reserved documents, it requires a more robust security layer than other REST APIs.
First, the API uses HTTPS rather than HTTP. You'll need to hook OpenSSL or another SSL library to the client application and call the proper Indy support code. Second, this API requires a separate authentication request, which will return an authorization token that will expire after some time. You'll have to pass this token into any following request (coming from the same IP address).
I don't want to cover all of the technical details of the actual code here, but I find the ability to work on a document available in the cloud with this level of precision quite mind-blogging. Here is the conclusion of the section of the white paper (after an image showing a sample spreadsheet with data that should be familiar to any Delphi developer) :
This code lets you populate the spreadsheet with new lines corresponding to database records. Now this doesn't prevent you (and anyone else with editing rights on the document) from editing the data once posted, it lets the document automatically recalculate totals based on the data sent by the client application, and makes it possible for anyone in the world with proper rights to see the resulting document.
So we have a sophisticated mechanism for viewing and editing data originating from database tables, automatically updated over time, with a robust permissions infrastructure -- simply thanks to a free Gmail account.
Here is the full video, for the technical description and the source code download my white paper and the companion code.