|
|
|
|
xmlFeed.js Functions
Variables
Libraries
TechNotes
|
|
The purpose of this library is to:
Download RSS feeds and to parse them into easy to use JavaScript arrays.
Manage read/unread marks using IDs of the news items. An ID for each item must be set in the RSS feed.
This library is used by channels.js and alertEngineEx.js.
Data Feed Array
Arrays storing data parsed from RSS feeds are 3 dimensional.
The data of each individual feed is stored as follow:
array['Type']
array['Title']
array['URL']
array['Feed_URL'] URL to the XML feed itself
array['Description']
array['Image']
array['Feed_Items']
When downloaded with channels.js, the RSS feeds are stored in feeds_data[][] as follow:
feeds_data[feed_index]['Type']
etc.
array['Feed_Items'] is an array filled with each headlines found in the RSS feed.
The data of each individual item is stored in array['Feed_Items'] as follow:
array['Feed_Items'][Index]['Title']
array['Feed_Items'][Index]['Description']
array['Feed_Items'][Index]['Date']
array['Feed_Items'][Index]['URL']
array['Feed_Items'][Index]['UID']
array['Feed_Items'][Index]['XML']
array['Feed_Items'][Index]['Feed']
The item ['UID'] is the unique identifier assigned to each news item., and ID is required if you use unread marks.
If no item ID is provided in the RSS feed, the publication date is used as unique ID.
The item ['XML'] stores the full XML code of the item. This can be used to retrieve the value of specific tags or attributes not supported by the standard type of feed.
The item ['Feed'] is a reference to the feed data array:
array['Feed_Items'][Index]['Feed'] = array
For example to retrieve the URL of the feed containing a specific news item:
array['Feed_Items'][Index]['Feed']['Feed_URL']
The type of feed, stored in array['Type'], can be one of the following values depending on the XML format:
MIOALERT
XML:1
XML/OPML
XML/ATOM
XML/RSS:1, XML/RSS:2
XML/RDF:1, XML/RDF:2
|
|
|