9.2 Overview of Google Ajax Feed API
A Google Ajax Feed is represented by the google.feeds.Feed class.
The Feed class has the methods discussed in Table 9.1. The Feed class
methods do not have a return type.
Table 9.1 Feed Class Methods
Method Description
load(callbackFunction) Downloads the feed from the Google server. The
callbackFunction gets invoked when the download is
complete. The callbackFunction is invoked with a
argument that represents the result of the feed.
setNumEntries(num) Sets the number of feed entries. Default value is 4.
setResultFormat(format) Sets the result format. One of the following values
may be specified:
google.feeds.Feed.JSON_FORMAT (the default),
google.feeds.Feed.XML_FORMAT, or
google.feeds.Feed.MIXED_FORMAT.
The Google Ajax Feed API generates a result document, whose
structure is different from either the RSS 2.0 or the Atom 1.0 feed. For
example, the chapter mentions elements such contentSnippet and
publishedDate. Neither Atom 1.0 nor RSS 2.0 have these elements.
The contentSnippet element corresponds to the snippet version of the
content or summary element in Atom 1.0 and description
element in RSS 2.0. The publishedDate element corresponds to the
9.2 Overview of Google Ajax Feed API 183
published element in Atom and the pubDate element in RSS 2.0.
Google Feed API uses its own set of result elements to generate a uniform
result format for the Atom 1.
Pages:
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166