Be a Supporter!
authorblues
authorblues
  • Member since: Jun. 21, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
As: Rss Class Mar. 15th, 2006 @ 01:16 PM Reply

AS: Main ain't Noise Pollution

Preferred Reading
AS: XML by Inglor
AS: Numerics - Recursion by Sekky (not required, but know what recursion means)

What is RSS?
no matter how you want to try to get around it, you still have to explain the acronym, so why dont we get that out of the way. RSS stands for "really simple syndication". but what does that mean? well, RSS is really the bastard child (read: a variant of) XML used for news feeds. pretend, if you will, that XML is the english language. RSS would be your accent (clearly 1.0 is a british accent and 2.0 is an american, or preferably non-regional, accent).

speaking of version numbers, at the time of writing this, there exist five distinct versions of RSS. the good news? all but two of them are obsolete and are no longer in use. all that remains is the charred rubble of a once great netscape empire and two versions of RSS: 1.0 and 2.0.

But why should I care?
because i told you to, so shut your mouth. the actual answer is that RSS is very simple to load into flash because RSS conforms to certain standards and conventions. in RSS 1.0, which is generally viewed in a format called RDF (raw data file) and uses tags such as <rdf:content>. RSS 2.0 (which is easier to read plaintext) is usually viewed in XML format and uses tags such as <description> and <pubDate>.

and what makes things better? the most common tags that you would be interested in (title, content, link) are all standard across RSS 1.0 and 2.0, meaning that if you look for the tag <content>, it will exist in both. what makes things worse? you have to look in different places.

So heres where the learning begins
To follow along, you can download my RSS.as class

Traversing the feed with Recursive Node Reading
Each feed starts off with some header tags to give information to RSS aggregators about the feed data and sources. These can be skipped for our purposes. If you look in the function sortFeed(), you can see that we immediately go down to the second child node for RSS 1.0, third child for RSS 2.0 (a bit of difference in header tags). Then we begin viewing the feed object by object.

in both forms of RSS, posts are seperated into tags called <item>. therefore, we can find what we are looking for by checking nodeType (1 means tag, 3 means text) and nodeName (== "item"). when we find an item tag, we send that entire node to another function to store everything we can about it. this makes recalling the info with both array notation and object properties simple.

by using my RSS.as and some cleverly applied components, you could create something like this RSS reader. (note: at the time of writing this, a few of the feeds are down. the only ones working are the macromedia ones and about 2 or 3 others)


BBS Signature
Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to As: Rss Class Mar. 15th, 2006 @ 01:21 PM Reply

I'm glad you chose RSS over making your own thing (taking my advice), made you able to create this, great work :)

authorblues
authorblues
  • Member since: Jun. 21, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As: Rss Class Mar. 15th, 2006 @ 01:23 PM Reply

At 3/15/06 01:21 PM, Inglor wrote: I'm glad you chose RSS over making your own thing (taking my advice), made you able to create this, great work :)

thanks. i dont even know why i was afraid of RSS. it looks daunting at first, but its actually quite simple in design, and very accessable.


BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to As: Rss Class Mar. 15th, 2006 @ 01:34 PM Reply

All you've done is show off your well commented (and sexy) class - not really a tutorial =\ Nice class, but you don't teach much about actual RSS.


Sup, bitches :)

BBS Signature
authorblues
authorblues
  • Member since: Jun. 21, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to As: Rss Class Mar. 15th, 2006 @ 01:39 PM Reply

At 3/15/06 01:34 PM, -liam- wrote: All you've done is show off your well commented (and sexy) class - not really a tutorial =\ Nice class, but you don't teach much about actual RSS.

its hard to cover all the XML properties over again, considering theyve been done already in inglors tutorial. i figured if i explained the RSS conventions, that would be enough to make the leap from XML to RSS. its like, if you already know how to multiply numbers together, and i show you what an integer is, i shouldnt have to teach you multiplication again. the only difference is in the type of number.


BBS Signature
Rantzien
Rantzien
  • Member since: Jan. 27, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to As: Rss Class Mar. 17th, 2006 @ 02:36 PM Reply

OMFPG thanks, I'd rather be taught about it though, but I'll figure it out anyway. The examples and "guide" about RSS that comes with flash sucks big not so hairy but rather jellyish bananas.


BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to As: Rss Class Mar. 17th, 2006 @ 02:40 PM Reply

At 3/15/06 01:21 PM, Inglor wrote: I'm glad you chose RSS over making your own thing (taking my advice), made you able to create this, great work :)

lol how come every thread you come in a take some sort of credit?


- Matt, Rustyarcade.com

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to As: Rss Class Mar. 17th, 2006 @ 02:53 PM Reply

At 3/17/06 02:40 PM, Ninja-chicken wrote: lol how come every thread you come in a take some sort of credit?

I'm glad you finally confronted him about that (with my guidance), good work.

;D

Sup, bitches :)

BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to As: Rss Class Mar. 17th, 2006 @ 03:14 PM Reply

At 3/17/06 02:53 PM, -liam- wrote:
At 3/17/06 02:40 PM, Ninja-chicken wrote: lol how come every thread you come in a take some sort of credit?
I'm glad you finally confronted him about that (with my guidance), good work.

;D

lol you are a funny guy liam : )
Seriously though he is right thats exactly what it's like somtimes.


- Matt, Rustyarcade.com

Madferit
Madferit
  • Member since: Jul. 29, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to As: Rss Class Mar. 17th, 2006 @ 03:32 PM Reply

Mmmm.... Sounds like some hwat e-sex. :)

BTW AB, nice tut.