Feeds

Retrieving RSS/Atom Feeds with the Google AJAX Feed API

Using feeds to manage online news.

Intelligent flash storage arrays

For JSON result format the <feed> element has the sub-elements described in the following table:

Sub-Element Description
title Specifies the feed title.
link Specifies the URL of the HTML version of the feed.
description Specifies the feed description.
author Specifies the feed author.
entries[] One or more entries may be present. Each entry has the following sub-elements: title-The entry title.link-URL of the HTML version of the entry.content- Specifies content of the entry including HTML tags. contentSnippet-A snippet version of the content. publishedDate-Date of publication.categories[]-One or more category String tags.

For google.feeds.Feed.MIXED_FORMAT result format, both the feed and xmlDocument sub-elements are present in the root element. An additional sub-element called xmlNode is present for each entry for MIXED_FORMAT. The xmlNode sub-element is a pointer to the XML element in the XML document in the xmlElement element.

The google.feeds.FeedControl class is used to download and display multiple feeds. The FeedControl methods are described in the following table:

Method Description
addFeed(url, label) Adds the feed specified by the url to the FeedControl.
draw(element, opt_options?) Loads the feeds and displays the feeds. The element argument specifies the DOM node that contains the resulting entries. The optional opt_options specifies the control options as a JSON object to display the results. The object has a single property called drawMode, which has the value google.feeds.FeedControl.DRAW_MODE_TABBED or google.feeds.FeedControl.DRAW_MODE_LINEAR (default).
setNumEntries(num) Specifies the number of entries for each feed. Default value is 4.
setLinkTarget(linkTarget) Specifies the link target to display the HTML for an entry. The following values may be specified:google.feeds.LINK_TARGET_BLANK google.feeds.LINK_TARGET_SELF (default)google.feeds.LINK_TARGET_TOP google.feeds.LINK_TARGET_PARENT

The Google Ajax Feed API provides a global method google.feeds.getElementsByTagNameNS(node, ns, localName), which returns a NodeList of elements of the specified local name and namespace URI.

Preliminary Setup

We want to develop a JavaScript application to download and display RSS/Atom feeds with the Google Ajax API. First, we need to register a web application URL with the Google AJAX Feed API to download and display Atom feeds.

We shall create the JavaScript application in JDeveloper. Download and install JDeveloper 10.1.3.2. To create a JDeveloper application select File>New and subsequently select General>Application in the New Gallery Click on OK. Specify an Application Name and click on OK. Specify a Project Name and click on OK. A new application and project are added to the Applications-Navigator.

Add a HTML page to the JDeveloper project by selecting the project node and selecting File>New and subsequently selecting Web Tier>HTML>HTML Page. An HTML page is added as shown in Figure 1.

Shows the JDeveloper Application.

We need to register the URL for the HTML page with the Google Ajax Feed API. Right-click on the HTML page and select Run. Obtain the URL, which is http://142.179.34.223:8990/GoogleRSS-GoogleRSS-context-root. Sign up for the Google AJAX Feed API using the URL http://code.google.com/apis/ajaxfeeds/signup.html as shown in Figure 2. Click on the Generate API Key button to generate the API key (you’ll need to be logged in to your Google user account to generate this).

Shows the generation of a Google Feed API key

Top 5 reasons to deploy VMware with Tegile

More from The Register

next story
Preview redux: Microsoft ships new Windows 10 build with 7,000 changes
Latest bleeding-edge bits borrow Action Center from Windows Phone
Google opens Inbox – email for people too thick to handle email
Print this article out and give it to someone tech-y if you get stuck
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
Entity Framework goes 'code first' as Microsoft pulls visual design tool
Visual Studio database diagramming's out the window
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
DEATH by PowerPoint: Microsoft warns of 0-day attack hidden in slides
Might put out patch in update, might chuck it out sooner
Redmond top man Satya Nadella: 'Microsoft LOVES Linux'
Open-source 'love' fairly runneth over at cloud event
prev story

Whitepapers

Choosing cloud Backup services
Demystify how you can address your data protection needs in your small- to medium-sized business and select the best online backup service to meet your needs.
Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.