Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: RSS Headlines - A PureMVC AS3 / AIR Demo  (Read 13359 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: January 01, 2008, 02:50:13 »

This demo illustrates the use of PureMVC with AIR to fetch an RSS feed, and display the headlines in a cycling display in small window on the desktop.

The demo has historically been located here: http://trac.puremvc.org/Demo_AS3_AIR_RSSHeadlines
The project has been moved here: https://github.com/PureMVC/puremvc-as3-demo-air-rssheadlines/wiki

The author is Simon Bailey.
« Last Edit: September 23, 2012, 12:13:31 by puremvc » Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #1 on: April 21, 2008, 08:58:14 »


Any chance of getting this updated for most current AIR release?

thx
--steve...
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: April 21, 2008, 09:13:33 »

I accepted the AIR update yesterday and this app still ran. Will it not compile?

-=Cliff>
Logged
mattb
Newbie
*
Posts: 7


View Profile Email
« Reply #3 on: July 27, 2009, 05:49:57 »

Hi,  I'm embarking on an similar app that will have multiple data sources of varying types which will expand in the future. Data will come from feeds and services such as RSS, ATOM, SOAP as well as some bespoke APIs. 

It will have many available services for the user to enable, but only a limited number can be enabled.

I was wonder what would be the best way to structure it, I was thinking something along the lines of..

Sources Definition / storage
A OPML file that defines all the possible services with url, title, poll interval, type and an enabled flag to indicate that this service is currently in use.

Then we can easily read/write/update this single file to change the sources.  I think storing this in a SQLite db would be overkill??  No relational data really and would be harder to update.



AS structure
A OPMLProxy to mange loading and saving of the main OPML file.

An interface IServiceProxy that defines the basic methods startPoll(), stopPoll(), pollNow(), parse() etc Or maybe an abstract that defines some more properties and private methods.

A Service class for each type of service - RssServiceProxy, AtomServiceProxy, MyApiServiceProxy -each will define parse in which ever way it needs to to extract the data required.

A ItemVO per service, RssItemVO, AtomItemVO, MyApiItemVO

The parse method of the Service class will parse to an ArrayCollection of VO's for that service.  I.e RSSServiceProxy's data will be an ArrayCollection of RSSItemVO's.


An overall SerivicesProxy that has methods such as addService( service ), removeService( service  ), hasService( url) that holds all the currently created services with some methods to retrieve them with some filtering perhaps getServicesByType( serviceType ) 


The basic set up would be load the OPML, retrieve all the enabled sources, for each instantiate an ServiceProxy based on its type (rss, atom, myApi etc), pass in a custom name for the proxy as we will have multiple instances of the same proxies as well as passing url, interval etc.  Then add this instance to the main ServicesProxy  and start polling it.


Does this sound ok?   Is there another way without having multiple instances of the same proxies - (although i don't see this as a bad thing)

And where should the timing code that actually triggers a poll for each service live?  Should this live in each ServiceProxy  - the startPoll() method would create the timer for that service within the proxy (based on its individual interval value from the OPML) and obviously send a note once the data is polled a parsed.

Each service proxy would hold all the items from the last poll, the overall ServicesProxy could have methods to get everything - returning an arrayCollection containing all items from all services.

Any feedback / pointers would be much appreciated.

m.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: July 31, 2009, 05:23:49 »

Have a look at the PipeWorks MultiCore demo and the AIR RSS Reader projects for some pointers on dealing with feeds.

-=Cliff>
Logged
Pages: [1]
Print