Back

Display Facebook Page RSS Feed

Description

Use this code to pull an RSS feed from Facebook for your institution's Page, and display the most recent item in your HTML code.

This feed only includes things posted by your institution, not comments or posts made by others on your Page.

This code also converts some internal Facebook URLs in the post into addresses that can be used from offsite (i.e. "/profile.php?id=49426403878" --> "http://facebook.com/profile.php?id=49426403878").

Code

#set($rssTotal = 1)

#pullRSSFeed("http://www.facebook.com/feeds/page.php?format=rss20&id=6420827863")
#set($Q = '"')
#foreach($content in $list)
 
        ## Make Facebook's odd relative URLs into URLs that work from another site
        #set($content.description = $content.description.replaceAll("href=.\/","href=${Q}http://www.facebook.com/"))
        #set($content.link = $content.link.replaceAll("^\/","http://www.facebook.com/"))
 
        <h3><a href="$!content.link">$!content.title</a></h3>
        <p>$!content.description</p>
#end