In this article you will learn how to setup the Facebook RSS Feed Reader in MVC 4. Let's look at an image of what we will be creating in this article; see:
Where to find the RSS feed of my wall?
To find the RSS feed for you wall, login to your Facebook account and then navigate to the URL https://www.facebook.com/notification. In the top you will find a link to open the RSS feed page.
Once you are there, you will notice the following page and its root <item>.
Now let's get started with the coding.
First of all create the following model classes.
public class FacebookRSS
{
public string Title { get; set; }
public string Link { get; set; }
public string Description { get; set; }
public string PubDate { get; set; }
}
public class FBRssReader
{
public static IEnumerable<FacebookRSS> GetFeed()
{
var client = new WebClient();
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
var xmlData = client.DownloadString("https://www.facebook.com/feeds/notifications.php?id=164214527076029&viewer=108743653424029&key=ACk_XJqgt56etdrK&format=rss20"); //remember to update this URL
XDocument xml = XDocument.Parse(xmlData);
var FBUpdates = (from story in xml.Descendants("item")
select new FacebookRSS




Sam HobbsPosted Dec 4, 2012, 4:57 PM
This looks interesting so I tried it. I am not failiar with MVC but I was able to stumble around in the dark and get this to work. Note that for finding the notifications URL it is not as direct as you show. What I did I think is, in my Facebook home page, click on the notifications icon (the globe?) and I think that took me to the page to see the RSS and then I got the URL. That was a little confusing for me since the key had a trailing underscore that did not get copied into my source code the first time so that did not work at first for me.