October Speedlinking

I haven't been able to post as often or as in depth as I'd like to have this past month. I chalk it up mostly to work, we all love 12 hour days right? But now that sign-off has passed and our last release of 2007 is calmly approaching (its on Friday), things have settled down a bit. Below are some great links from October, most of which I wanted to mention at some point and haven't gotten a chance to until now. Enjoy.

My First Google API ticket has been fixed

My first ticket for the Google Document List API has been fixed. As I posted about [before](http://gpowered.blogspot.com/2007/08/quick-docs-api-example- python.html), the Document List API did not have the ability to just retrieve the documents from a given folder or tag. This has now been made possible, thanks API team!

Original ticket:

It would be ideal if we could pull back a list of documents from a certain folder. This would give more functionality and make the size of the data smaller if you only needed to grab a list of file from a certain folder.

Possibly something like: gdata.docs.service.DocumentQuery(folder=['myfolder1']) or gdata.docs.service.DocumentQuery(folders=['myfolder1','folder2'])

C'mon Google! Get in Gear!!

As of this morning (or at least sometime before lunch), Zoho Writer turned on offline mode with Google Gears. If you haven't heard about Gears yet is a small application (and framework for developers) to enable Ajax applications to go offline. It uses a very small local server and database to grab all the data you would need should the application go offline (this has to be set up by the developers of the application). There is a great podcast about it [here](http://google-code- updates.blogspot.com/2007/06/google-developer-podcast-episode-three.html) from the Google Developer Podcast. The first Google product to use it was Google Reader which I though was pretty nifty. Before you go on a trip, just hit "Go Offline" and it will download all of your unread posts... get on the plane and shazam, all your reading to keep you busy.

Zoho currently only supports offline read which I assume means Gears will grab all of your documents and you can read them over. Zoho says they will be adding read/write functionality in 3-4 weeks.

I must say though, I'm very disappointed that Google got beat to having this in Docs and Spreadsheets first. I'm sure it would help a great deal with the Google Office Hacks book that Philipp Lenssen is writing. C'mon Google, GET IN GEAR(S)!!

Quick Docs Api Example (python)

To use the gdata docs python client you need to upgrade to 1.0.7 or higher. First thing is to import the modules you'll need.

import gdata.docs.service
import gdata.docs

Then, set up the usual authentication parameters for the client.

gd_client = gdata.docs.service.DocsService()
gd_client.email = 'timothy.broder'
gd_client.password = '*****'
gd_client.source = 'gpowered-docs-list-ex'
gd_client.ProgrammaticLogin()

The most basic query will just return all of your documents

feed = gd_client.GetDocumentListFeed()

However, if we want to display just the spreadsheets, we build the query like this:

q = gdata.docs.service.DocumentQuery(categories=['spreadsheet'])
feed = gd_client.Query(q.ToUri())

Finally, we output the titles

if(len(feed.entry) == 0):
        print 'No entries in feed.\n'
for i, entry in enumerate(feed.entry):
        print '%s %s (%s)' % (i+1, entry.title.text.encode('UTF-8'))

If we wanted to, we could also import the DateTime library and show when the document was last updated

import gdata.docs.service
import gdata.docs

from mx import DateTime

gd_client = gdata.docs.service.DocsService()
gd_client.email = 'timothy.broder'
gd_client.password = '*****'
gd_client.source = 'gpowered-docs-list-ex'
gd_client.ProgrammaticLogin()

q = gdata.docs.service.DocumentQuery(categories=['spreadsheet'])
#feed = gd_client.GetDocumentListFeed()
feed = gd_client.Query(q.ToUri())

if(len(feed.entry) == 0):
        print 'No entries in feed.\n'
for i, entry in enumerate(feed.entry):
        dt = DateTime.ISO.ParseDateTimeUTC(entry.updated.text)
        print '%s %s (%s)' % (i+1, entry.title.text.encode('UTF-8'), dt.strftime('%m/%d/%Y %I:%M %p'))

For me this outputs:

1 TDP2006 Contact Info (11/18/2006 05:41 AM)
2 contact info (07/23/2006 08:15 PM)
3 Tim and Rob (08/09/2007 10:18 PM)
4 nyc happy hour spreadsheet (07/04/2007 08:25 PM)
5 public_spring_2006_roster (10/16/2006 12:40 AM)
6 dax2006 (11/12/2006 11:23 PM)
7 project dream (07/13/2007 03:54 AM)
8 Stuff Tim should get (06/13/2007 01:53 AM)
9 Erg Test Results - 9/26 (10/15/2006 01:02 AM)
10 Head of the Charles Regatta Itineary (10/17/2006 04:54 PM)
11 tvshows (11/02/2006 11:44 PM)
12 HF (10/01/2006 03:36 PM)