Hi HarleyPig, Thank you for sharing your plans, it would be great to have a Perl library out there for people to use. I'm assuming this will be open source. If so, what kind of license will you use?
On Jun 27, 10:55 pm, HarleyPig <[EMAIL PROTECTED]> wrote: > I'm about half finished with a set of perl modules for the GData > protocol. I'm wondering if I have the basics understood correctly. > First, here are the (simplified) steps I'm thinking the code would > need to handle: > > Attempt to GET, POST, PUT or DELETE a request (I'm assuming the module > for the specific service will handle the formatting of the content). > > Handle the response code appropriately. Except for a response code of > 403, just return success or fail to the calling routine. In the case > of a 403 code, attempt to authorize. If that's successful attempt the > request again and return appropriately. Be sure to follow the redirects which are issued by some of the services (I imagine you've seen this with calendar). Also, if the server responds with a non-2xx code, be sure to pass along the contents of the message. The error messages from the services describe what exactly went wrong, so this information is valuable. > > Fairly simple up to this point. What I'm not sure of is how to handle > the response. It seems to me that if I put the XML::Atom libraries in > the GData module then the service libraries wouldn't have to worry > about it--making for less chances of errors. However, I'm not sure > that just returning a XML::Atom::[Feed|Entry] object would be at all > helpful or even a good idea. Since the Google data structures are based on Atom, this should be a good starting point. The Google data APIs add new XML elements to the standard Atom feed and entry models and each service has some unique items of it's own. Since this is the case, I would recommend extending the Atom classes to handle the custom extension elements for each service. This could be a bit of work, but it makes the library much more convenient for developers and avoids the problem of having to sort out which parts are standard Atom, and which parts are specific to calendar or spreadsheets for example. If you just relied on XML::Atom, things like the Who, Where, and When elements would need to be accessed like this: my $gd = XML::Atom::Namespace->new(gd => 'http://schemas.google.com/g/ 2005'); my $who = $entry->get($gd, 'who'); Please note, I didn't test the above, just guessing :-) > > Any input? I encourage you to send out your code, or create an open source project so that people can take a look and give you more detailed feedback. I'd be happy to look at it and I know a few others who would as well. You might also want to look at the Zend PHP library to get some ideas. http://framework.zend.com/download/gdata Happy coding, Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
