Sunday, 25 April 2010

IDAT210 - Facebook, Flash and RSS

The first stage in creating my project is to set up the Facebook location from which the textual data will be retrieved.  The easiest way to get the information from this location is using RSS which will check the page for updates and then update xml code accordingly to store the information.  This may seem like a simple task but it actually took some development to find all the right elements to make this happen.  Originally I planned to make a Facebook group which I could invite people to, which they could then add comments to.  Once I had created the group however, I found that Facebook does not provide an inbuilt RSS feed for groups. I therefore went searching for ways in which it would be possible to get a feed from the page and came across two different tools, Yahoo Pipes, and page2rss.com.
Yahoo Pipes is a small application builder which allows people to create all sorts of programs quickly and easily.  One of the applications that I found here was a tool specifically for making rss feeds from Facebook which took the group id of a Facebook group and then created an rss feed for that page.  I therefore endeavoured to make this work, but found that it did not seem to work very well for my group and did not provide me with the feed I wanted.  I then continued searching for a solution and found page2rss.com.
Page2rss.com is a service similar to that of the Pipes app I found but that takes any page url and turns it into an rss feed which checks for updates.  I therefore put in the url of the Facebook group hoping that this would be ok.  However on adding information ot the group wall I found that the page did not seem to be updating enough, and that when it did it provided me with a lot of extraneous information from page2rss.  Being that these two methods were unsuccessful for Facebook groups I began to consider other areas of Facebook which I could use for my project.  After searching through  different sections of Facebook I discovered that Facebook Pages were an area of Facebook that had inbuilt RSS feeds.  I therefore created a Facebook page for my project with its own RSS feed and got the url for this feed so that the data could be parsed into my Flash application.
The next hurdle to overcome was getting this feed properly into Flash.  To begin with I just tried using a stndard xml parse to get the rss data into th Flash environment as RSS is in the XML format.  However this only seemed to partly work as the important information seemed to be missing from the data and so I began researching into getting RSS into Flash with AS3.  After looking at a number of bits of code online I discovered that in AS2 it seemed that you could import RSS similarly to XML but that AS3 may be more difficult.  I then came across a RSS/ATOM Flash library for parsing RSS to flash called NewsATOM_cs3 from http://lucamezzalira.com/2009/02/07/parsing-rss-10-20-and-atom-feeds-with-actionscript-3-and-flash-cs4/.  This libary is an open source library developed from the as3sydicationlib and made compatible for Flash by Luca Mezzalira, and allows users to parse RSS 1.0, 2.0 and ATOM feeds.  I therefore downloaded it and started using it for the base of my project to allow RSS parsing for the Facebook page.

No comments:

Post a Comment